RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 17 Dec 2013 09:49 AM |
The Part of The Script Doesn't find the highest point on the leaderboard and gets stuck at "Round hs Ended!" any ideas? :/ the script : i've added '--' tags where the script starts and ends (the one that doesnt work)
local backup = game.Lighting.CarLevel1Black:clone() local backup2 = game.Lighting.CarLevel1Blue:clone() local backup3 = game.Lighting.CarLevel1Red:clone() debounce = false while true do a = Instance.new("Hint", Workspace) a.Text = "Loading Game..." wait(2) a.Text = "Data Persistence Loading..." wait(2) a.Text = "System Updating..." wait(2) a.Text = "Cars Regenerating..." wait() --Black Car Regeneration game.Workspace.CarLevel1Black:Destroy() local CarLevel1Black = backup:clone() CarLevel1Black.Parent = game.Workspace CarLevel1Black:MoveTo(game.Workspace.CarSpawn1.Position) CarLevel1Black:MakeJoints() debounce = false --Blue Car Regeneration game.Workspace.CarLevel1Blue:Destroy() local CarLevel1Blue = backup2:clone() CarLevel1Blue.Parent = game.Workspace CarLevel1Blue:MoveTo(game.Workspace.CarSpawn2.Position) CarLevel1Blue:MakeJoints() debounce = false --Red Car Regeneration game.Workspace.CarLevel1Red:Destroy() local CarLevel1Red = backup3:clone() CarLevel1Red.Parent = game.Workspace CarLevel1Red:MoveTo(game.Workspace.CarSpawn3.Position) CarLevel1Red:MakeJoints() debounce = false wait(2)
lol = (math.random(1,1)) -- it will chose a number between 1-5 if lol == 1 then b = Instance.new("Message", Workspace) b.Text = "Loaded Game!" a.Text = "The Person Who Collects The Most Points Wins!" wait(5) b.Text = "Get Ready!" wait(1) b.Text = "3" wait(1) b.Text = "2" wait(1) b.Text = "1" wait(1) b.Text = "Start!" target = Vector3.new(-29.657, 2.5, 1340.248) for i, v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) end wait(3) a:Remove() b:Remove() end game.Workspace.Scriptme.Transparency = 1 game.Workspace.Scriptme.CanCollide = false wait(60) c = Instance.new("Message", Workspace) c.Text = "Round has Ended!" wait(1)
--THIS PART DOESN'T WORK :| for i,v in pairs(game.Players:GetPlayers()) do if v:findFirstChild("Points") then if v.Points.Value > highestpoints then highestpoints = v.Points.Value highestplayer = v.Name highestplayer.leaderstats.wins.value = wins.value + 1 wait(1) local m = Instance.new("Message", Workspace) m.Text = "The Winner Is: " ..v.Name.. " With: " ..v.Points.Value else m.Text = "The Game Is A Tie" --script ENDS HERE ABOVE DOESNT WORK^^^
wait(3) game.Workspace.Scriptme.Transparency = 0 game.Workspace.Scriptme.CanCollide = true for i, k in pairs(game.Players:GetChildren()) do hum = k.Character:findFirstChild("Humanoid") hum.MaxHealth = 0 c:Remove() end end end end end
I would really appreciate your help! :/
|
|
|
| Report Abuse |
|
|
RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 17 Dec 2013 09:55 AM |
| Ok to be more clear, the part that doesn't work needs to find the highest point collected on the leaderboard, and then find who collected it (player name) and then rewards him with a +1 win. but sadly the script gets stuck at c.Text = "Round has Ended!" and then skips the part that doesn't work, and then starts a new game. |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2013 10:19 AM |
| u maked that big script ._. |
|
|
| Report Abuse |
|
|
RoboX790
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 285 |
|
|
| 17 Dec 2013 11:33 AM |
| one part doesn't work idk why ._. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Dec 2013 02:44 PM |
| is this a building script or what? |
|
|
| Report Abuse |
|
|