New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I store the gui somewhere else for later use?

Asked by 10 days ago

I currently have a screengui in startergui but i want it so that when i join the game the screengui isnt there but when i click on the dummy it appears. How would i go about doing this?

local Click = game.Workspace.Dummy.ClickDetector Player = game.Players.LocalPlayer

Click.MouseClick:Connect(function()

end)

2 answers

Log in to vote
0
Answered by 10 days ago
Edited 10 days ago

Here is your script hopefully fixed, use a serverscript under dummy

local Click = game.Workspace.Dummy.ClickDetector 

Click.MouseClick:Connect(function(player)
    player.PlayerGui.ScreenGui.Enabled = true
end)

If that does not work try this but put your ClickDetector in the Dummy's torso.

local Click = game.Workspace.Dummy.Torso.ClickDetector 

Click.MouseClick:Connect(function(player)
    player.PlayerGui.ScreenGui.Enabled = true
end)

The script just get the player who clicked in the event and get there GUI and make it visible.

So on your line local Click = game.Workspace.Dummy.ClickDetector Player = game.Players.LocalPlayer

You shouldn't get the LocalPlayer over a ServerScript. The LocalPlayer is only used for LocalScripts. The MouseClick event already gives you the player so you would not need it.

I think a ClickDetector only works under a part, so if that does not work use the other codeblock.

You can ask me clarification anytime :)

Ad
Log in to vote
0
Answered by 10 days ago

ScreenGuis all have a property called Enabled. You can use this to say wether a ScreenGui will be visible or not.

local Click = game.Workspace.Dummy.ClickDetector Player = game.Players.LocalPlayer

Click.MouseClick:Connect(function()
    Player.PlayerGui["SCREENGUINAME"].Enabled = true
end)
0
Wait, I'm sorry but where am i supposed to place my screengui? FireCoolflame 5 — 10d

Answer this question