I've tried putting this script inside a fire object using the boolvalue "flareson"
if game.workspace.flareson.value = true then script.Parent.Enabled = true else script.Parent.Enable = false
but the fire object is on, even though flareson's value property is unchecked.
To constantly sense the status of an object, do this:
game.Workspace:WaitForChild("flareson").Changed:Connect(function(IsOn)--IsOn will return as the value of the flare script.Parent.Enabled = IsOn end)
Short and sweet. With further questions/comments/concerns, feel free to reply. Happy scripting! ~mc3334
your syntax is wrong it should be
function flareson() if game.Workspace.flareson.Value == true then script.Parent.Enabled = true else script.Parent.Enabled = false end end
you need two equal signs when comparing values in an if statement, only one is needed when setting/changing values