Hello, I want to make a player unable to leave a seat. (Similar to breaking point.) I have tried welding the plr’s legs to the seat but that made them fly across the map. Any suggestions? Thanks!!
Maybe this thread would help?
1 Like
I believe you can achieve that by changing Humanoid.JumpHeight
to 0
2 Likes
changing the Humanoids JumpPower to 0 seems to work for me
1 Like
Alr, I’ve tried this and what @Valkyrop suggested, and it still doesn’t work. I also earlier forgot to specify that it’s a vehicle seat.
1 Like
Anchor the players humanoid root part maybe? Not sure just a random idea.
1 Like
--SERVER
local Game = game
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Seats = {} --Cache of each player's last seat.
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid", 10)
if Humanoid then
local function OnHumanoidSeated(Active, Seat)
if Active then
Seats[Player] = Seat
else
Seat = Seats[Player]
if Seat then
Seat:Sit(Humanoid)
end
end
end
Humanoid.Seated:Connect(OnHumanoidSeated)
end
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
local function OnPlayerRemoving(Player)
Seats[Player] = nil
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoving)
1 Like
Simply set the player’s jump power/jump height to 0. It will make them unable to leave the seat.
1 Like
I forgot to tell you this yesterday but I figured out it wasn’t working cause I forgot to set jumppower enabled instead of jumpheight. Thanks!
1 Like
function onTouched(part)
local h = part.Parent:findFirstChild(“Humanoid”)
h.JumpPower = 0
end
script.Parent.Touched:connect(onTouched)
1 Like