jellp
|
  |
| Joined: 15 Jan 2009 |
| Total Posts: 448 |
|
|
| 23 Jul 2013 03:19 PM |
So I am trying to make a team specific GUI currently, but ran into a problem I do not know how to fix.
The error I get is attempt to concatenate local 'player' (a userdata value)
Script:
function onEntered(player) print("PLAYER ENTERED") local s = Instance.new("Script") --createscript( [[name = "]] .. player[i].name .. [[" createscript( [[name = "]] .. player .. [[" ov = Instance.new("ObjectValue") ov.Value = game.Players:FindFirstChild(name) ov.Name = "TeamGUI" ov.Parent = script player = ov.Value function oa(object) local elplayer = game.Players:playerFromCharacter(object) if elplayer ~= nil then if elplayer == player then local torso = object:FindFirstChild("Torso") if torso ~= nil then wait(5) if torso.Brickcolour("Navy blue") then game.StarterGui.Navyblue:GetChildren() [c].Visible = true end end end end end game.Workspace.ChildAdded:connect(oa) ]],game.Workspace)
Sorry for the code being a bit of a mess, I also didn't include all the code as I am certain the last piece of code is right. |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 23 Jul 2013 03:22 PM |
Just a warning: if you're trying to edit the source of a Script object, please disregard your imminent failure as that is no longer possible. There could be a lot of things wrong here. I'm going to go by your syntax and hope you know what you're doing.
function onEntered(player) print("PLAYER ENTERED") local s = Instance.new("Script") --createscript( [[name = "]] .. player[i].name .. [[" createscript( [[name = "]] .. player[i].Name .. [[" ov = Instance.new("ObjectValue") ov.Value = game.Players:FindFirstChild(name) ov.Name = "TeamGUI" ov.Parent = script player = ov.Value function oa(object) local elplayer = game.Players:playerFromCharacter(object) if elplayer ~= nil then if elplayer == player then local torso = object:FindFirstChild("Torso") if torso ~= nil then wait(5) if torso.Brickcolour("Navy blue") then game.StarterGui.Navyblue:GetChildren() [c].Visible = true end end end end end game.Workspace.ChildAdded:connect(oa) ]],game.Workspace) |
|
|
| Report Abuse |
|
|
jellp
|
  |
| Joined: 15 Jan 2009 |
| Total Posts: 448 |
|
| |
|