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

How can i convert this server script work in a local script?

Asked by
NexeusX 137
7 years ago

Hey i am trying to edit all my scripts to work with filtering enabled for more security, can someone help with changing this one, i've put it in a local script but idk why or how i should use a remoteevent/function and if you could give me some tips on converting scripts to work on filtering enabled that would be very helpful.

script.Parent.ClickDetector.MouseClick:connect(function(player)
player.PlayerGui.Shop.Frame.Visible = true
end)

1
The good news is that a ClickDetector now works with FE. User#5423 17 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

Here is what you could do:

player = game.Players.LocalPlayer

script.Parent.ClickDetector.MouseClick:connect(function
player.PlayerGui.Shop.Frame.Visible = true
end)

PLEASE NOTE that the game.Players.LocalPlayer variable is only available in LocalScripts!

Ad

Answer this question