Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Comparing IntValues with a number?

local players = game.Players:GetChildren()
local plr3 = players[3]
local statp3 = plr3.Character:WaitForChild("Ow").Value
if statp3 == 1 then
				statp3 = 3
			elseif statp3 == 0 then
				statp3 = 2
			end

statp3 is an IntValue inside the player's character. Whenever i kill someone i want it to change to a certain number determined by what the statp3 number currently is. But even when statp3 == 1 it still skips it and goes to the elseif line and changes statp3 to 2.

1 answer

If statp3 is an IntValue, the issue you're having is that statp3 is an object, not a number! To get the number out of the object, use statp3.Value, and similarly, to set it, use statp3.Value=num.

This discussion is preserved as it was. New answers, comments, and votes are closed.