I'm testing this script in humanoid were if the npc sits down with a baton, it would stand up with this script inside humanoid:
if script.Parent.Sit = true then script.Parent.Jump = true end
I'm not sure if this is correct since I'm not an expert at scripting, and here's the sit script if you hit the humanoid with a baton.
function onTouched(hit) h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then h.Sit = true h.Health = h.Health - 0 end end script.Parent.Touched:connect(onTouched)
In this part of the script you need to use "==" to detect something or else it will think its trying to change something.
if script.Parent.Sit = true then script.Parent.Jump = true end
Fixed Script (also its seeing if they jumped and if they jumped they jump again?)
if script.Parent.Sit == true then script.Parent.Jump = true end
function onTouched(hit) local h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then h.Sit = true h.Health = h.Health - 0 end end script.Parent.Touched:connect(onTouched)
Fixed Script (you were trying to subtract nothing from the players health instead of killing them, btw if this doesent work then It could be because of of FE, the "h" is not finding the humanoid or both)
function onTouched(hit) h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then h.Sit = true h.Health = 0 end end script.Parent.Touched:connect(onTouched)
Accept if this helped! :D