I want the script to check if NPC is sit is true then wait a few seconds then makes the NPC jump. But it looks right to me but it doesn't work. The appreciated you help.
local v = script.Parent.Parent:findFirstChild("Humanoid") if v.Sit then wait(7) v.Jump = true end
Please don't post hateful comments I am just a kid who wants and is trying to learn Lua
As OldPalHappy says you can use StateChanged event of Humanoid. However since I am not professional on it I will suggest Changed event :) I do not know if you know functions or events yet, but here's an example for you.
v = script.Parent.Parent:findFirstChild("Humanoid") --First of all, let's create a function function PropertyChanged() --Now the if condition if v.Sit then wait(7) v.Jump = true end end --For sure, do not forget about connecting function to an event. v.Changed:connect(PropertyChanged)
This code will start PropertyChanged function each time a property of script changes, including Sit.