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

If you sit, a GUI pops up? [closed]

Asked by 9 years ago

This question already has an answer here:

If you sit, a GUI pops up?

I know basic scripting, I just don't know all the basics. So, I can't get my script to work. The script basically should have a GUI pop up when you sit on it, and when you get off it should go away(I don't know how to do that).

script.Parent.ChildAdded:connect(function()
    game.Players.PlayerGUI.Gui.Frame.Visible = true
end)

Thanks.

0
Who ever downvoted this has no right to.. DeciusGalerius 20 — 9y
0
Actually they do. Duplicate questions should not be posted, and you have not made any better attempt at the creation of your script. M39a9am3R 3210 — 9y

Marked as Duplicate by woodengop, M39a9am3R, and evaera

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 9 years ago

This Way, If You Sit, It First Searchs For "SeatWeld", Which Is A Weld That Appears When You Sit. Then It'll Insert A Gui Into Your PlayerGui(PlayerGui is In Player Always. If You Have Something In StarterGui, It Automatically Goes To Player Gui.)

script.Parent.ChildAdded:connect(function(newChild)
    if newChild.Name == "SeatWeld" then
        local Gui = Instance.new("ScreenGui", game.Players:GetPlayerFromCharacter(newChild.Part1).PlayerGui)
    end
end)
0
You should give more information and provide how your script works. woodengop 1134 — 9y
0
Doesnt work. DeciusGalerius 20 — 9y
Ad