I am trying to make it so, if a value is 5 then print "ded" but if a value is not 5, then print Survived. But it's printing Survived even tho the value is 5. I tried setting the value to 5 before starting the game, and then it worked. Why is this happening? How can I fix this? This is the script:
script.Parent.MouseButton1Click:Connect(function()
wait(1)
wait(10)
game.Lighting.StigForever1.Parent = game.Workspace
wait(10)
if game.ReplicatedStorage.CamNr.Value == 5 then
print("5")
wait(5)
end
if game.ReplicatedStorage.CamNr.Value == 5 then
print("ded")
else
print("Survived")
end
end)

6 comments
how are you changing the value? Via local script or server script?
In a normal script.
Please define normal script with a type.
What? I 'm using a script (I guess server script) in StarterGui.
So, do you know how to fix it?
Oh, I tried a local script and it worked...