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

How can i do this?

Asked by 8 years ago

i tried to make it remove some value from something in a script and then if the value got to 0 the player dies

while true do
game.Workspace.HungerValue = game.Workspace.HungerValue.Value - 1
wait(5)
end

if
    game.Workspace.HungerValue.Value == 0
    then
    player.health = 0
end

0
Is this your whole script? Cuvette 246 — 8y
0
yes tntcameronzd 20 — 8y
0
put the if inside of the while loop theCJarmy7 1293 — 8y
0
First of all, you're going to want to have the Value inside each player and secondly you haven't defined player. It doesn't know what player is or where to search for it. Cuvette 246 — 8y
0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ theCJarmy7 1293 — 8y

Answer this question