I am trying to make a folder in server storage called "gui" clone into the players "PlayerGui". But its not working...
I made a LocalScript in Workspace with the folloing code inside:
serverStorage = game.GetService("ServerStorage") game.Players.PlayerAdded:conect(function(player) local guiloader = serverStorage.gui:Clone() player:WaitForChild("PlayerGui") guiloader.Parent = player.playergui end)
One problem is simply the fact that you are using a Localscript. Try using a regular Script.
The reason for this is that ServerStorage
and ServerScriptStorage
are only accessible by regular scripts, and ReplicatedStorage
and ReplicatedFirst
are only accessible by Localscripts.
The other problems are as follows:
You need to change 'playergui' on line 8 to 'PlayerGui'
Change the period on line 1 to a colon. GetService
is a method, and you need to use it properly.
Change "conect" on line 3 to "connect". Simple spelling error.
Your final code should now look like this:
serverStorage = game:GetService("ServerStorage") game.Players.PlayerAdded:connect(function(player) local guiloader = serverStorage.gui:Clone() player:WaitForChild("PlayerGui") guiloader.Parent = player.PlayerGui end)
Anyways, I hope this helped. If not, or if you have any further problems/questions, please leave a comment below, and I'll see what I can do. Hope I helped!
local serverstorage = game.ServerStorage game.Players.PlayerAdded:connect(function(player) serverstorage.gui:Clone().Parent = player.PlayerGui end)
i use
local serverStorage = game.ServerStorage
instead of
serverStorage = game:GetSerive("ServerStorage")
if it helps upvote me pls