Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

0
I'm pretty sure you can't put a script in StarterPlayerScripts that is meant for the character TrustedInstaIler 17 — 4y
0
Logan, make a answer GamingWithFlight 80 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Put the Script in StarterCharacterScripts

--This question was answered by Logan_Developer
Ad

Answer this question