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: Script does not work in game.

Previous Thread :: Next Thread 
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 08:46 AM
So the script works in studio.
When in games it gives me error's like.
"Pants is not a valid member of Model"


script.Parent.touched:connect(function(hit)
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Pants.PantsTemplate = pantsid
hit.Parent.Shirt.ShirtTemplate = shirtid
end
end
end)

Report Abuse
jango464 is not online. jango464
Joined: 30 Jul 2009
Total Posts: 4913
24 Jul 2015 08:51 AM
Capitalize Touched

Rev up those fryers!
Report Abuse
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 09:05 AM
Fixed a good amount of the errors but still does not work.

Updated script with no errors

local debo = false
script.Parent.Touched:connect(function(hit)
if hit then
if not debo then
debo = true
if hit.Parent:FindFirstChild("Humanoid") then
print(hit.Parent.Name)
hit.Parent.Pants.PantsTemplate = pantsid
hit.Parent.Shirt.ShirtTemplate = shirtid
end
end
end
wait()
debo = false
end)

it prints the players name so why not change its clothing?
Report Abuse
Npokemonmaster2alt is not online. Npokemonmaster2alt
Joined: 13 Dec 2014
Total Posts: 135
24 Jul 2015 09:13 AM
have you given pantsid and shirtid a value?

at the start of the script put

pantsid="whateverid"

shirtid="whateverid"
Report Abuse
jango464 is not online. jango464
Joined: 30 Jul 2009
Total Posts: 4913
24 Jul 2015 09:16 AM
Or if you used a number value make sure you do:

local pantsid = whereveritis:WaitForChild("pantsid")

Rev up those fryers!
Report Abuse
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 09:29 AM
No they are defined.
Should I just do the ID number or the whole url?
Report Abuse
ChuckXZ is not online. ChuckXZ
Joined: 26 Jan 2012
Total Posts: 2996
24 Jul 2015 09:34 AM
This script is messy


Chuck Ex Zee
Report Abuse
NeptuneElement is not online. NeptuneElement
Joined: 03 Feb 2013
Total Posts: 104
24 Jul 2015 09:49 AM
local shirtid = "http://www.roblox.com/asset/?id="IDOFSHIRTHERE"
local pantsid = "http://www.roblox.com/asset/?id=IDOFPANTSHERE"
Report Abuse
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 10:41 AM
that how they are.
Report Abuse
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 10:42 AM
That is how they variable is.
Also its not the messy. I have not scripted in years.
Report Abuse
gravy456 is not online. gravy456
Joined: 17 Jul 2007
Total Posts: 17
24 Jul 2015 10:48 AM
Figured it out.
Thanks for the help.
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