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

Value scripting (If then) help? [ANSWERED]

I tried making this script where if the value hits this then it does that except the script isnt working if script.Parent.Value == 107 then

2 answers

Is the name of the value "Value"? Because if then you always need to define the value of a value, to compare it to something else. If the name of the value is "Value" then the script should actually look like this:

script.Parent.Value.Value == 107 then

EDIT: I see the problem now, when you put this in the script, it only checks the value once, then stops, to solve this you could use a loop to check the value every so often, perhaps like this

while true do
	if script.Parent.Value == 107 then
		
	end
	wait(0.5)
end

This would check the value every half second to see if it is 107 You could also use this:

script.Parent.Changed:Connect(function()
	if script.Parent.Value == 107 then
		
	end
end)

This would check if the value is 107 every time the value is changed

1 comment

0

The script is in the value btw

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