GUI not appearing when touching a model of my roblox skin

So, i wanted to make a script where if i clicked on the model of my skin, it’d play an animation (in a separate script, which worked) and make a gui appear.
This bug has been happening since the start of my project, and not even chatGPT could help. I tried many different versions, yet it didnt work anyways.

This is the recentest version of my script which obviosuly doesnt work. What did i do wrong?! it gives no error message, but it just doesnt execute the script.

local Clash = script.Parent
local CD = Clash.ClickDetector

CD.MouseClick:Connect(function(click)
	if click then
		game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = true
	end
end)

This should be under #help-and-feedback:scripting-support , it’s not a Forum Bug!

LocalScripts also don’t work in the Workspace. You will need to place it somewhere like StarterGui or StarterPlayerScripts.

1 Like

Use ClickDetector for Server-sided only.

Do it like this:

  • Click detector with Server script.
  • The same Server script calls the RemoteEvent to the client.
  • Now a Local script from LocalPlayer that detects the RemoteEvent
  • Then Enable the Screengui inside the LocalPlayer
1 Like

So i have to put the same script, however in another place?

You need to learn the basics of communication between the Client and the Server. I suggest researching that first.

Will do that, thanks for the tip.

1 Like

Yes, but you’ll also need to edit some parts of your script. Like @Sorbious said, ClickDetectors will not work on LocalScripts.

I’ll break down what you need to do here (in text):

Under a ServerScript, with the parent being the ClickDetector:

  1. Use Remote Events, from Server to Client. Add a RemoteEvent under ReplicatedStorage.
  2. Connect the Script such that when the ClickDetector gets triggered, it will fire the RemoteEvent through the Client.

Under a LocalScript, in StarterGui/StarterPlayerScripts:

  1. Connect a function to trigger when the RemoteEvent is fired.
  2. Just write the code on enabling the Gui for the LocalPlayer, and you’re done!

Sorry if I didn’t explain this very well, I just want to run through briefly what you’ll have to do. Hope you’ll be able to fix your code!

1 Like

Thanks very much. It looks good and correct from what i know. thanks for the help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.