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
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
|
| 24 Jul 2015 08:51 AM |
Capitalize Touched
Rev up those fryers! |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 2996 |
|
|
| 24 Jul 2015 09:34 AM |
This script is messy
Chuck Ex Zee |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 17 Jul 2007 |
| Total Posts: 17 |
|
| |
|
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
|
  |
| Joined: 17 Jul 2007 |
| Total Posts: 17 |
|
|
| 24 Jul 2015 10:48 AM |
Figured it out. Thanks for the help. |
|
|
| Report Abuse |
|
|