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

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

Asked by 4 years 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 4 years ago
Edited 4 years 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 4 years 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 21 — 4y

Answer this question