function ouch() if ouch.Parent:FindFirstChild("Humanoid") then ouch.Parent.Humanoid.Sit=true end end script.Parent.Touched:Connect(ouch)
Pretty new to scripting, so I'm not the best at doing this. What should I change here?
The reason for this is ouch.Parent is a function, functions don't have parents. What you should be doing is this...
function ouch(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Sit=true end end script.Parent.Touched:Connect(ouch)
A cleaner way to do this would be:
script.Parent.Touched:connect(function(ouch) if ouch.Parent:FindFirstChild("Humanoid") then ouch.Parent.Humanoid.Sit = true end end)