Hi guys, so, I've spent 2 hours (It's 4:30AM now) trying to solve ONE simple error. I've made this script that would give certain users a weapon and a GUI above their head.
The script is pasted in StarterPack (It's a local script), where a BillboardGui is the script's child, and the Textlabel is the Gui's Child.
Please keep in mind I'm a literally all-new scripter and don't know much about usage of variables and such, but this is what I came up with:
local plr = game.Players.LocalPlayer
local name = plr.Name
local admins = Instance.new("BoolValue",game.Workspace.Admins)
local tool = game.ServerStorage['weapon']
local gui = script.Role
if game.Workspace.Admins:FindFirstChild(name) == nil then
admins.Name = name
admins.Value = false
else
print("BoolValue already exists!")
end
if name == "NameHere" or name == "NameHere" then
admins.Value = true
print(plr.Name.." is an Admin!")
tool:Clone().Parent = plr.Backpack
gui.Role.Visible = true
gui:Clone().Parent = game.Workspace:FindFirstChild(name).Head
gui.Role.Visible = false
print ("Added GUI and Tools!")
else
print(plr.Name.." is not an Admin!")
end
Now, the error I'm receiving is; "Players.XaqiZono.Backpack.Administrators:20: attempt to index a nil value" The error is occuring on line 20, the part where I clone the GUI inside the script, and move the cloned GUI onto the user's head. How can I fix this?
Also; How do I stop my script from executing UNTIL LocalPlayer is loaded?
And, one more question; I don't really know the diffrence between Local script and Server Script, but is there a diffrent way of calling a LocalPlayer via a Server Script?
Thanks!

2 comments
Thanks! I've implemented the new Instance method, and made a Server-sided script rather than a local one. Used a function to address the player.Character and it all works now!
No problems!