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

Click Detector -> Local Script?

I made local script in click detector

local ClickDetector = script.Parent
ClickDetector.MouseClick:Connect(function()
	script.Parent.Parent.Parent["Change Class"]:Destroy()
	
end)

It didn't work as I expected... it should like Destroy the npc when u click on the npc but it doesn't do anything

2 answers

Do it in a normal script in workspace, because local scripts only work in player-sided objects (ex. StarterPlayerScripts)

3 comments

0

I did it for opening gui but I can't cuz if I open gui through normal script I can close it in button. I tried to make a button to close the gui through the server but it didn't work...

0

use TextButton.MouseButton1Down instead

0

How do I get the Plr now? :u, I can't use parameter there I guess..

If you want to use a LocalScriptm you'd have to fire a RemoteEvent from the client to the server.

1 comment

0

Oh sorry, I mean't from the Server to the Client!!

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