Hello, ive made a localscript that gets enabled by a normal script that should enable a value and a gui, but it doesnt seem to work at all. The localscript gets enabled and all but it just doesnt do anything. The LocalScript is also inside the StarterPlayerScripts folder, ive tried multiple before but it didnt work. Heres the code that I made.
The MaskGui is a Gui that is disabled in StarterGui. The MaskValue is just a BoolValue in ServerStorage, its not too important.
local MaskGui = game.Players.LocalPlayer.PlayerGui.Mask local MaskValue = game.ServerStorage.WearsMask MaskGui.Enabled = true MaskValue.Value = true
Also heres the code that I used to enable the localscript, it is inside a ProximityPrompt. MaskScript is the LocalScript that should run the code above.
local ProximityPrompt = script.Parent ProximityPrompt.Triggered:Connect(function(player) game.StarterPlayer.StarterPlayerScripts.MaskScript.Disabled = false end)
- Every child/descendants of StarterPlayerScripts are reparented into: game.Players > plrInstance > PlayerScripts
(assuming it's a server script) 2. Server Scripts (Regular Scripts) can't access game.Players.LocalPlayer
- Client Scripts (LocalScript) can't access ServerStorage nor ServerScriptService
You will have to use RemoteEvent to do this, and that's probably only one of the thousand's ways of doing it.