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

How do I detect if a player sat down using a script?

I want to detect if a player sat down using a script. I already made a script, but it does not work. The script is a local script and is in StarterPlayerScripts.

Here is the script:

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
 
humanoid.Seated:Connect(function(isSeated, seat)
	if isSeated then
		if seat then
			print ("The player is now sitting in the seat named "..seat.Name.."!")
		end
	else
		print("The player is no longer sitting!")
	end
end)

Here is the output: https://gyazo.com/4345128bdec21acf91c73aa25fb105aa

2 comments

0

I'm pretty sure you can't put a script in StarterPlayerScripts that is meant for the character

0

Logan, make a answer

1 answer

Put the Script in StarterCharacterScripts

--This question was answered by Logan_Developer

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