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

I want a frame to be visible when I sit and when I'm not sitting it goes away, why wont it work?

dont take the comments seriously lol

--bcuz u ru dumb this is to detect if they sit lol
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	--bcuz u r dumb this is for the script to end when they jump
	if humanoid == nil then return end
	--this is 4 u know what
	frame.Visible = true
end)

the answers you gave me didnt work :(

2 answers

Easy fix, you forgot to toggle it off:

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
    if Seat.Occupant == nil then 
        frame.Visible = false
        return
    end
    frame.Visible = true
end)

1 comment

0

stonks

We are not looking for whether the humanoid exists, we are looking for whether the seat has an occupant or not. Use this bit of code inside your Connect method:

if seat.Occupant == nil then
	frame.Visible = false
else
	frame.Visible = true
end

Please note that this code has to be in a LocalScript

Hope this helped!

1 comment

0

maybe stonks idk

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