ZonixJoin Date: 2008-03-09 Post Count: 130 |
I seem to be having troubles with a regeneration script that regenerates the map and gives me the game total in points. It isn't working, but it's probably because I'm not exactly sure where to put it.
-If you can help me, please send me a message.
-There is a reward.
-Thanks |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
bring it up. |
|
|
i have published a really good regen script in my models its never failed me, try it out |
|
|
oops said wrong thing in other reply
yur problem is that u havn't moved yur script into the model you want regened,move it inside the model you want regened |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
So do I group my whole map and place the script in it?
-Thanks |
|
|
group all the stuff u want regened then put the script inside |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
So, say this regen script is timed and regens every 15 minutes and gives me the game score, would I need to put the leader board in the group too? |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Hmmm... |
|
WeyugiohJoin Date: 2008-01-20 Post Count: 181 |
you would need a leaderboard if you whant the game score...if you didn't there is no way to keep score of the K.O.'s/W.O.'s/ or whatever |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Yeah. I thought so , I'm going to test it out now.
-Thanks |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Nope, not working. =/ |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Hmm...Does anyone have a working one? |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
I found one, but it is not working, can I send it to one of you so you can see what's wrong? |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
100 tix reward. |
|
banyuJoin Date: 2007-10-22 Post Count: 181 |
while true do
wait(60) -- replace 60 with the amount of time in seconds you want waited
local parent = script.Parent
local h = Instance.new("Message")
h.Parent = game.Workspace
h.Text = "Regening map"
wait(2)
h:remove()
parent:clone().Parent = game.Workspace
parent:remove()
end
|
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
But I also need it to give me a points total. |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
This is not my script, but for example where do I put it and what do I need to get it to work?
local game_length = 300 -- every X seconds, end the game, show a message, regen the map, rebalance teams, cause MASSIVE LAG
local red_stuff = game.Workspace.RedTeamRegen:clone()
local blue_stuff = game.Workspace.BlueTeamRegen:clone()
message = nil
function showMessage(text)
-- This function flashes a message to all players
-- Clear the message with hideMessage()
hideMessage() -- Never show more than one message at a time
if message == nil then message = Instance.new("Message") end -- only make a message if we don't have a message object lying around
message.Text = text
message.Parent = game.Workspace
end
function hideMessage()
if message == nil then return end
message.Parent = nil
end
function RegenRed()
game.Workspace.RedTeamRegen:remove()
local new_stuff = red_stuff:clone()
new_stuff.Parent = game.Workspace
new_stuff:makeJoints()
end
function RegenBlue()
game.Workspace.BlueTeamRegen:remove()
local new_stuff = blue_stuff:clone()
new_stuff.Parent = game.Workspace
new_stuff:makeJoints()
end
function clearPlayerInfo()
-- resets KOs and WOs
local players = game.Players:children()
for i = 1, #players do
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.KOs ~= nil) then players[i].leaderstats.KOs.Value = 0 end
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Wipeouts ~= nil) then players[i].leaderstats.Wipeouts.Value = 0 end
end
end
function getWinnerInfo()
-- returns a string that we display to everyone about who the winner is
-- in case of tie, no one wins. if someone wants to code something better, be my guest.
local highscore = 0
local winner = "No one"
local tie = false
local players = game.Players:children()
for i = 1, #players do
local pscore = -1
if players[i]:findFirstChild("leaderstats") ~= nil then
if players[i].leaderstats.Points ~= nil then
pscore = players[i].leaderstats.Points.Value
end
end
if pscore == highscore then
tie = true
end
if pscore > highscore then
-- new highscore
highscore = pscore
winner = players[i].Name
tie = false
end
end
if tie == true then return "Tie game!" end
local text = string.format("%s %s %d %s", winner, "wins with", highscore, "points!")
return text
end
function getWinningTeamString()
local red = 0
local blue = 0
local p = game.Players:children()
for i=1,#p do
if (p[i].TeamColor == game.Teams:findFirstChild("Allies").TeamColor) then
if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.KOs ~= nil) then
blue = blue + p[i].leaderstats.KOs.Value
end
end
if (p[i].TeamColor == game.Teams:findFirstChild("Axis").TeamColor) then
if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.KOs ~= nil) then
red = red + p[i].leaderstats.KOs.Value
end
end
end
if (red == blue) then return "Teams Tie!" end
if (red > blue) then return string.format("Red won the match by %d points!", red - blue) end
return string.format("Blue won the match by %d points!", blue - red)
end
while true do
wait(game_length - 30)
showMessage("30 seconds left until end of game!")
wait(5)
hideMessage()
wait(25)
-- put up winning team info
showMessage(getWinningTeamString())
wait(2)
RegenRed()
RegenBlue()
showMessage("Rebalancing teams and launching new game...")
wait(5)
clearPlayerInfo()
game.Teams:rebalanceTeams()
hideMessage()
end |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Please, anyone? |
|
LarryZJoin Date: 2008-02-05 Post Count: 22 |
I'm still new at the whole scripting thing, but if I tried hard enough I could read it... but are there SUPPOSED to be 2 equal signs in a row like that? That doesn't seem like it would do any good.. |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
I don't know. =( |
|
ZonixJoin Date: 2008-03-09 Post Count: 130 |
Help? |
|