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

How to make a billboard gui display again when exiting a seat?

Asked by 6 years ago

I'm getting quite a headache from this. So the script that I've created detects if a player is close to a seat, so that when E is pressed, they sit on it. I've also created a billboard and a textbutton within it which displays the prompt "E".

So far, everything is working fine. The TextButton disappears when I sit down which is what I wanted, but when I leave the seat, the TextButton dosen't come back. So far, I haven't come up with any solutions to the problem, so thats why i'm here to ask you guys for help. Does anyone know any methods I could use to solve this problem?

What i'm trying to also figure out is how would I make it so that if I press E again, it will leave the seat without pressing space?

local Gui = game.Workspace.ChairMesh.BillboardPart:WaitForChild("EToInteract")
local frame = Gui:FindFirstChild("TextButton")
local player = game.Players.LocalPlayer
local seat = game.Workspace.ChairMesh.Chair


game:GetService("UserInputService").InputBegan:connect(function(input)
    if (player.Character and player:DistanceFromCharacter(seat.Position) < 5) and input.KeyCode == Enum.KeyCode.E then
        seat:Sit(player.Character.Humanoid)
frame.Visible = false

 end
end)


Again, thanks for the support laddies

0
Doing stuff like that with humanoids causes funky behaviour, at least from my experience, might wanna make the sitting server side User#24403 69 — 6y
0
Thanks! I'll need to look more into this than I thought Stephanie_Angela 2 — 6y
1
When a player sits a weld is created you can check with an event for when this weld is removed to show the frame again User#5423 17 — 6y
0
You might need to call Sit on the server side User#5423 17 — 6y
View all comments (2 more)
0
Thank you, i'll try my best Stephanie_Angela 2 — 6y
0
Also, there is a property of the humanoid called seatpart theking48989987 2147 — 6y

Answer this question