Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My script won't detect the Humanoid.SeatPart?

I saw the SeatPart property of the Humanoid as I needed it for my game, I'd never used it before so I experimented but it doesn't work. My local script won't print (warn) 2.

script.Parent.MouseButton1Click:Connect(function()
	local plr = game.Players.LocalPlayer
	local char = plr.Character
	if char.Humanoid.Sit == true then
		warn("1")
		if char.Humanoid.SeatPart == game.Workspace.Plots.University.Chair.University then
			warn("2")
			local study = script.Parent.Parent.Study.Text
			while char.Humanoid.SeatPart == "University" do
				wait(5)
				warn("3")
				game.ReplicatedStorage.Studies:FireServer(study)
			
			end
	end
		
	end
end)

3 comments

1

The Humaniod.SeatPart return the SeatPart itself not the Name of the SeatPart. So you should do SeatPart.Name https://developer.roblox.com/en-us/api-reference/property/Humanoid/SeatPart

0

Zomspi make sure you do more research than asking.

0

@JesseSong I will next time, but I looked on our profile and you have 3 questions that are: "Are serverscriptservice and serverstorage the same thing" - Easily re-searchable "Can someone give me a full list of all the services" - Easily re-searchable "Can someone define the script Touched:Wait() for me" - Easily re-searchable -=- I am sorry but please don't complain when you do the same

1 answer

✓ Accepted answer

Hello! This might help you:

if char.Humanoid.SeatPart.Name -- I added a Name, as that object has a Name.

Hope It helps :). EDIT: There is one more part you have to switch up, right here:

while char.Humanoid.SeatPart.Name == "University" -- I changed this to name. 

This discussion is preserved as it was. New answers, comments, and votes are closed.