Seat is not sitting humanoid

Hello, ive been stuck on this issue for hours, and no matter what i try the script refuses to work how i want it to. So what i have is a script that loops through a folder of seats and each seat is set to a global seat value.

When the prompt is triggered, it should sit the humanoid of the player who triggered it, but no matter what I edit and change, the script refuses to sit the player humanoid. I really am not sure what is going wrong, I am getting no errors in the output. This is my script;


local Seats = script.Parent.Seats

local ProximityPromptService = game:GetService("ProximityPromptService")


for _ , v in pairs(Seats:GetChildren()) do
	
	Seat = v
	
	SeatPrompt = Seat:FindFirstChild("SeatPrompt")

	
end
	

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	
	if Seat.Occupant ~= nil then
		
		SeatPrompt.Enabled = false
		
	elseif Seat.Occupant == nil then
		
		SeatPrompt.Enabled = true
		
	end
	
end)

ProximityPromptService.PromptTriggered:Connect(function(SeatPrompt , plr)

	local Humanoid = plr:FindFirstChildOfClass("Humanoid")
	
	Seat:Sit(Humanoid)
	
	print("Test")

end)



Any help would really be appreciated, I’ve been stuck on this for so long and it is frustrating

The print statement in the PromptTriggered runs, but not the Seat:Sit()

local Humanoid = plr.Character:FindFirstChildOfClass("Humanoid")
Should work i hope

that is what i am using. no matter what method i use to get humanoid, it will not seat humanoid

Sorry I did not realize it said plr.Character, thank you very much it works now

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.