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)
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 :)
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)