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 » Scripters
Home Search
 

Re: Spawning script

Previous Thread :: Next Thread 
grunt1994 is not online. grunt1994
Joined: 04 Oct 2008
Total Posts: 1201
03 Jul 2016 11:37 AM
I've made this script so that when you spawn into the game it removes body meshes, clothes and changes your body colour... I literally just threw it together in a min or so but it doesn't work (Suprise, suprise) Just wondering if anyone can throw a quick fix my way incase i'm missing something i did wrong. Thanks

function onSpawn(Char)
print("Starting")
if game.Players:FindFirstChild(Char.Name)~=nil and Char:FindFirstChild("Humanoid")~=nil then
local pl = Char:GetChildren()
for i= 1, #pl do
if pl:IsA("CharacterMesh") and pl:IsA("Shirt") and pl:IsA("Pants") then
pl:remove()
end
wait()
local col = Char:FindFirstChild("Body Colors")
col.TorsoColor = BrickColor.new(math.random("Bright Red","Bright Blue","Bright Green","Bright Yellow"))
col.LeftLegColor = BrickColor.new("Black")
col.RightLegColor = BrickColor.new("Black")
end
end
print("Done")
end

game.Workspace.ChildAdded:connect(onSpawn)
Report Abuse
Mkoalko is not online. Mkoalko
Joined: 26 Dec 2011
Total Posts: 186
03 Jul 2016 11:39 AM
if pl:IsA("CharacterMesh") and pl:IsA("Shirt") and pl:IsA("Pants") then

switch the ands for or
Report Abuse
Place_2 is not online. Place_2
Joined: 01 Jun 2016
Total Posts: 2541
03 Jul 2016 11:41 AM
function onSpawn(Char)
print("Starting")

if game.Players:FindFirstChild(Char.Name)~=nil and Char:FindFirstChild("Humanoid")~=nil then
local pl = Char:GetChildren()
for i,v in pairs(pl) do
if v:IsA("CharacterMesh") or v:IsA("Shirt") or v:IsA("Pants") then
pl:remove()
else
print(v.Name.." is neither of these")
end
wait()
local col = Char:FindFirstChild("Body Colors")
col.TorsoColor = BrickColor.new(math.random("Bright Red","Bright Blue","Bright Green","Bright Yellow"))
col.LeftLegColor = BrickColor.new("Black")
col.RightLegColor = BrickColor.new("Black")
end
end
print("Done")
end

game.Workspace.ChildAdded:connect(onSpawn)



haven't looked at anything below 'local col'

but your first problem is your function removes anything that is a shirt AND pants AND mesh
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
03 Jul 2016 12:54 PM
Cant you just disable that Character Load Appearance thing in Lighting?
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
03 Jul 2016 01:02 PM
^ it's not in Lighting

http://wiki.roblox.com/index.php?title=API:Class/StarterPlayer/LoadCharacterAppearance
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
03 Jul 2016 01:07 PM
Whoops... My bad.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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