local Whitelisted = {"Sergiomontani10"}
game.Players.PlayerAdded:connect (function(plr)
for i,v in pairs(Whitelisted) do
if v == plr.Name then
plr.Chatted:connect(function(msg)
if msg == "/pistol" then
for i,v in pairs(plr.Backpack:GetChildren()) do
game.Lighting.PistolSpawner:Clone() = game.Players.LocalPlayer.PlayerGui
end
end
end
end)
end
end
end)
Im trying to make a pistol spawner for my game but cant seem to find out how am I suppost to fix this up to where when you say "/pistol" and are whitelisted it would have a GUI cloned to your PlayerGui. Is there any possible way I can fix this and maybe even learn my error?

6 comments
This one also failed, Im not sure what it is. Its in a Server script.
@Sergio Then why down vote our answers because you were not specific enough? If your a scripter you should at least know that you can not access LocalPlayer from server scripts. Just follow what he told you above and what i told you so that you can try and figure it out.
I clearly said to put the script in a Local Script...
I did put it in a Local Script, before I had it in a Server Script.
I never down voted your questions. My reputation isn't even high enough. @Nikkulai
Learning to script wayyyy after this was made. I figuered this out.