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: Stupid script not working

Previous Thread :: Next Thread 
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:15 AM
This script is supposed to check if a user has a shirt, tshirt, or pants and remove them. Also hats. It isn't giving me any errors and I have tried all that I can please help!

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
repeat wait() until p.Character and c:findFirstChild("Body Colors")
bodycolors = c["Body Colors"]
yellow = "Bright yellow"
green = "Camo"
blue = "Bright blue"
bodycolors.HeadColor = BrickColor.new(yellow)
bodycolors.LeftArmColor = BrickColor.new(yellow)
bodycolors.LeftLegColor = BrickColor.new(green)
bodycolors.RightArmColor = BrickColor.new(yellow)
bodycolors.RightLegColor = BrickColor.new(green)
bodycolors.TorsoColor = BrickColor.new(blue)
local d = c:GetChildren()
for i=1, #d do
if (d[i].className == "Hat") then
d[i]:Destroy()
end
end
if c then return end
if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
c.Head.face.Texture = "rbxasset://textures/face.png"
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
end)
end)
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:16 AM
halpp?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:17 AM
Cheater, anyone!?!?!?!?!
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:19 AM
Freaking Lag.

What I wanted to write is, you should put some prints to see, where the script even runs to.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:20 AM
kk
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:22 AM
ok, found it, but i dont know the problem

if c then return end
if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed 4")
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed 5")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:23 AM
Found what???
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:25 AM
found the error

look and check please

if c then return end
if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed 4")
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed 5")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:26 AM
Where's the error if you found it? Is it not printing something or what?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:27 AM
This clunk doesnt work

if c then return end
if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed 4")
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed 5")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:29 AM
You mean it doesn't work from "if c then return end" on?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:30 AM
ok, removed

if c then return end

but now


if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end


doesnt wrok
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:32 AM
Isn't it Shirt Graphics? Can't check right now.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:32 AM
No, it's shirt graphic
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:33 AM
Can you even remove it or is it locked aswell as Body Colors?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:40 AM
Yes you can

now i am having roubles under line 25

idk wat it be

if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed33")
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:43 AM
Euhm line 25... which one is line25?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:45 AM
I just posted below line 25, but here it is:

if c.Pants ~= nil and c.Shirt ~= nil then
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed33")
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
print("passed41")
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:46 AM
if c:findFirstChild("Pants") ~= nil and c:findFirstChild("Shirt") ~= nil then --if there's no Shirt and no Pants, nothing happens
print("Shirts and pants exist, removing them")
c.Pants:Destroy()
c.Shirt:Destroy()
else
print("User has no pants or Shirt")
end
print("passed33") --does this print?
c.Head.face.Texture = "rbxasset://textures/face.png"
print("passed")
if c["Shirt Graphic"] ~= nil then
c["Shirt Graphic"]:Destroy()
else
print("User has no tshirt")
end
print("passed41")
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:49 AM
everything works fine, but it doesn't remove the shirt and pants :[.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:51 AM
nvm, it works for now, but doesnt remove the shirtgraphic
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:52 AM
I think it's because it's locked.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:53 AM
LOL nvm
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
25 Jul 2012 04:54 AM
No, it isn't that. There is an image named roblox inside of the torso that contains the shirt graphic.
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