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.
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)
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?