Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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.

2 comments

0

Who ever downvoted this has no right to..

0

Actually they do. Duplicate questions should not be posted, and you have not made any better attempt at the creation of your script.

1 answer

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)

2 comments

0

You should give more information and provide how your script works.

0

Doesnt work.

This discussion is preserved as it was. New answers, comments, and votes are closed.