So I'm trying to make my script not work if the local player's sit value is true.
the directory is: game.Players.LocalPlayer.Humanoid.Sit
when I try to do:
() if game.Players.LocalPlayer.Humanoid.Sit = true then wait (999999) end
my actual script is down here ()
my script just doesn't work anymore. I need a way to basically ask my script, is the local character sitting down and if they are, wait (9999999)
Thank you! =D
P.S. (If you're wondering, I'm new at lua)
In comparing/testing for values, we don't use a single equal sign, but a double. A single equal sign is used to assign a variable:
Assigning a variable:
x = 2
Comparing two values:
if game.Players.LocalPlayer.Humanoid.Sit == true then wait(1337) end
local player = game.Players.LocalPlayer local character = workspace:WaitForChild(player.Name) while true do if character.Humanoid.Sit == true then wait(999999) else wait() end end
This is a continuous loop variant of the sit value, however, you could check it whenever the player begins to sit or with another activated event like so.
local player = game.Players.LocalPlayer local character = workspace:WaitForChild(player.Name) character.Humanoid.Changed:Connect(function() if character.Humanoid.Sit == true then wait(999999) else wait() end end)
A single "=", as you attempted, is used to change values, while a double consecutive "==" is used to check if a value is equal to what comes after.