|
| 26 Oct 2011 01:11 PM |
function playeradded(newplayer) print ("NewPlayer Name: " .. newplayer.Name) print ("Newplayer Parent: " .. newplayer.Parent.Name)
player = newplayer.Character playermodel = game.Workspace:FindFirstChild(player)
shirt = playermodel:FindFirstChild(Shirt) pants = playermodel:FindFirstChild(Pants) shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=62836987" pants.PantTemplate = "http://www.roblox.com/asset/?id=62836935"
end game.Players.PlayerAdded:connect(playeradded)
Can you please explain to me why this isn't working? Thanks. I'm getting an error when trying to assign playermodel that value of game.Workspace:FindFirstChild(player).
Cheers. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 26 Oct 2011 01:36 PM |
NewPlayer Name: Player Newplayer Parent: Players Wed Oct 26 19:35:35 2011 - Argument 1 missing or nil Wed Oct 26 19:35:35 2011 - Script "Workspace.Script", Line 6 Wed Oct 26 19:35:35 2011 - stack end |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2011 01:42 PM |
you need quotes right next to "player" inside of the findFirstChild
example: findFirstChild("Player") also lua is case-sensitive so it's findFirstChild |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 26 Oct 2011 01:43 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) wait(1) -- Give the pants and shirt time to spawn character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=62836987" character.Pants.PantTemplate = "http://www.roblox.com/asset/?id=62836935" end) end) |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2011 02:28 PM |
^^Player is a variable. ^Thanks, the code you've given me has worked. What's wrong with this?
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) wait(1) -- Give the pants and shirt time to spawn if player:IsInGroup(220375) then --In TRAA character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=35255306" character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=58492061" end
if player:IsInGroup(165491) then --In TRA character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=35255306" character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=58492061" end
if player:IsInGroup(244199) then --Military Police character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=60331655" character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=60331678" end end) end)
No error BTW. |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 26 Oct 2011 02:32 PM |
| Should work. Probably because when you play solo, 'Player' isn't a member of the group. That or your assetURLs are wrong. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2011 04:09 PM |
| Thank you for all of your help, I appreciate it. |
|
|
| Report Abuse |
|
|