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

BoolValue won't print anything after changing the value?

StarterPlayer > StarterPlayerScripts > Trip(boolvalue) > TripS (script)

if script.Parent.Value == true then
print("tripped")
elseif script.Parent.Value == false then
print("untripped")
end

When i change the bool value to true it wont print anything

2 answers

✓ Accepted answer

That code will only run once, if you want it to keep checking (even though there are better ways of doing this) try putting it in a while true do loop with the wait function somewhere in it.

while true do
	--Any code here will run every frame.
	wait()
end

Hello. A while loop is not the best method for that. You can use the Changed event. Here is an example:

workspace.MyBoolValue.Changed:Connect(function()
	if workspace.MyBoolValue.Value == true then
		print("The value is: True")
	else
		print("The value is: False")
	end
end)

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