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
Your script shows a lack of attempt, but I can help with the solving of your problem.
You can use the ChildAdded event for the seat.
SeatLocationHere.ChildAdded:connect(function() --This should fire when a weld is placed. end)
Now that a weld is in place (done automatically by ROBLOX), we can find the humanoid occupying the seat.
SeatLocationHere.ChildAdded:connect(function() --This should fire when a weld is placed. plr = game.Players:GetPlayerFromCharacter(SeatLocationHere.Occupant.Parent) --Since Occupant is the humanoid of the character, we will want to use Parent to find the character. end)
Finally, we will want to change the GUI property to show the item as visible.
SeatLocationHere.ChildAdded:connect(function() --This should fire when a weld is placed. plr = game.Players:GetPlayerFromCharacter(SeatLocationHere.Occupant.Parent) --Since Occupant is the humanoid of the character, we will want to use Parent to find the character. plr.PlayerGui.Gui.Frame.Visible = true end)
Next time, when posting on this site, have a better attempt at making a script, otherwise you will get downvoted and your question may get marked as Not Constructive.