generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: UniForim Regulation Script

Previous Thread :: Next Thread 
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
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
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
26 Oct 2011 01:12 PM
Ignore my typo please.
Report Abuse
VenomGuardian is not online. VenomGuardian
Joined: 14 Jul 2011
Total Posts: 174
26 Oct 2011 01:14 PM
show us the output
Report Abuse
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
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
VenomGuardian is not online. VenomGuardian
Joined: 14 Jul 2011
Total Posts: 174
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 is not online. 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
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
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 is not online. 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
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
26 Oct 2011 04:09 PM
Thank you for all of your help, I appreciate it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image