Hello, i wrote a script when player joins he seats on the chair. Player doesnt sit but teleports to the seat. The script is server script. Any help appreciated!
The code:
local plrs = game:GetService(“Players”)
plrs.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
task.wait(0.3)
local hum = char:WaitForChild(“Humanoid”)
local seat = workspace:WaitForChild(“Map”):WaitForChild(“Chair”):WaitForChild(“Seat”)
seat:Sit(hum)
end)
end)
1 Like
This usually happens because the player’s animation is not loaded yet in the game and they are forced to sit.
I had a similar problem a while ago and I just played the Roblox’s Sit animation in the character, here’s how you can do it too!
seat:Sit(Humanoid)
Humanoid.Animator:LoadAnimation(animation):Play()
-- you may use this R15 sitting animation ID: "http://www.roblox.com/asset/?id=507768133"
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.