Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't the points get added?

Asked by 8 years ago

Hi there,

I'm making a game called Crumble Runner, and I'm making a system of how long they survive. At the end of the round, the longer they survive the more points they get. It's a Script in StarterPack. However, when the round ends the points don't seem to be added for some reason. Can someone help me?

Code:

local gameIsPlaying = game.ServerStorage.ValueStorage.GameIsPlaying
local player = script.Parent.Parent
local timer = 0
player.InGame.Changed:connect(function()
    if player.InGame.Value == true then
        wait(3)
        repeat
            wait(1)
            timer = timer + 1
        until player.InGame.Value == false or timer == 80
        repeat wait() until gameIsPlaying.Value == false
        player.Points.Value = player.Points.Value + timer
        timer = 0
    end
end)

I'd really appreciate it if someone could help me with this.

Thanks, PickUpTheBeat1.

0
No errors. All I know is that it occured on this line: repeat wait() until gameIsPlaying.Value == false NeonicPlasma 181 — 8y
0
Where do you set that value to false? GoldenPhysics 474 — 8y
0
In another script in Workspace. NeonicPlasma 181 — 8y
0
Set some random prints throughout the script so you know where it doesn't work at. I'm guessing it has something to do with player.InGame.Value not changing correctly. Also double check that script.Parent.Parent is the player   Ethan_Waike 156 — 8y
View all comments (3 more)
0
I did that already, it stopped occuring on the line in the above comment. NeonicPlasma 181 — 8y
0
This is probably not the problem, but it could be. The script resets every time the player dies, so I might have to put it in starter scripts. NeonicPlasma 181 — 8y
0
Yeah it worked when I did it in StarterGui! NeonicPlasma 181 — 8y

Answer this question