How do I make a GUI pop up when I sit down on a seat just for the person sitting on the seat ;
I put this script under the seat
local Seat = script.Parent -- Seat
local PlayerSitting -- Blank Variable
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if Seat.Occupant == nil then -- Player Jumped Out
if PlayerSitting ~= nil then -- Player Is In Game (Did not Leave Game)
local PlayerUI = PlayerSitting:WaitForChild("PlayerGui")
local NeededUI = PlayerUI:FindFirstChild("Frame") -- Change this To Your GUI Name
NeededUI.visible = false
PlayerSitting = nil -- Set The Var to nil
end
else -- Someone Sat Down
PlayerSitting = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent)
local PlayerUI = PlayerSitting:WaitForChild("PlayerGui")
local NeededUI = PlayerUI:FindFirstChild("Frame") -- Change this To Your GUI Name
NeededUI.visble = true
end
end)
(I copied and pasted this script from a developer online I found but this code still does not work)
I tried using the RemoteEvent thing and starterplayerscripts but nothing worked. I can sit on the chair but once I sit nothing happens.
** You are now Level 1! **