My player won't sit when touching a part(More specifically a union).
Here's the code:
script.Parent.Touched:Connect(function(hit)
game:GetService("Players").LocalPlayer.Humanoid.Sit = true
end)
Can someone explain this issue? Thanks if you can.
My player won't sit when touching a part(More specifically a union).
Here's the code:
script.Parent.Touched:Connect(function(hit)
game:GetService("Players").LocalPlayer.Humanoid.Sit = true
end)
Can someone explain this issue? Thanks if you can.
LocalPlayer is only used for local scripts , game:GetService("Players") isn't necessary.
If you want the script to work then try this:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:FindFirstChild("Humanoid").Sit=true
end
end)
hit.parent is basically the player who touched it.
This discussion is preserved as it was. New answers, comments, and votes are closed.