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

This works in test mode, but no in-game?

Asked by 7 years ago

OK so I have a GUI called "greenpower" and It's current Parent is ServerStorage.

I also have a tool and when i activate it (clicking) the GUI is supposed to move to the Player's PlayerGui.

This works just fine in test mode, but in actual game it doesn't.

LocalScript:

local player = game.Players.LocalPlayer
local power = game.ServerStorage:WaitForChild("greenpower")
local plrgui = player:WaitForChild("PlayerGui")
script.Parent.Activated:connect(function()
    power:Clone().Parent = plrgui

end)

Help?

2
Local scripts do not have access to the server storage, put the gui some where the player can access it such as replicated storage. User#5423 17 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I'm not an expert but I'm pretty sure Local scripts doesn't have permissions to access the Replicated Storage, if you go into developer console(F9) in play mode you will definitely see the error there, thus fixing it shouldn't be that hard.

0
thanks Lukeisbossman64 73 — 7y
Ad

Answer this question