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

0

how are you changing the value? Via local script or server script?

0

In a normal script.

0

Please define normal script with a type.

0

What? I 'm using a script (I guess server script) in StarterGui.

0

So, do you know how to fix it?

0

Oh, I tried a local script and it worked...