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: So yeah

Previous Thread :: Next Thread 
coolblox2334 is not online. coolblox2334
Joined: 10 Dec 2010
Total Posts: 4605
23 Nov 2013 04:23 PM
I'm making a morph script.
CODE_START
local ShirtId = "129000815" -- Change inside the quotes to the ID of the shirt you want
local PantsId = "129001983" -- Change inside the quotes to the ID of the pants you want

function ChangeShirtPants(bla)
checkshirt = hit.Parent:FindFirstChild(Shirt)
checkpants = hit.Parent:FindFirstChild(Pants)
if checkshirt == nil then
print ("No shirt detected")
s = Instance.new("Shirt", hit.Parent)
s.ShirtTemplate = "http://web.roblox.com/?id=" + ShirtId
else
checkshirt.ShirtTemplate = "http://web.roblox.com/?id=" + ShirtsId
end
if checkpants == nil then
print ("No pants detected")
p = Instance.new("Pants", hit.Parent)
p.PantsTemplate = "http://web.roblox.com/?id=" + PantsId
else
checkpants.PantsTemplate = "http://web.roblox.com/?id=" + PantsId
end
end

script.Parent.Touched:connect(ChangeShirtPants(bla))
CODE_END
Output:
error: attempted to index bla (a nil value)
Report Abuse
Greendolph is not online. Greendolph
Joined: 07 May 2008
Total Posts: 2543
23 Nov 2013 04:33 PM
script.Parent.Touched:connect(ChangeShirtPants(bla))

It might be trying to pass bla through to the function here. You don't need to explicitly state the input of a touched connection here. Try

script.Parent.Touched:connect(ChangeShirtPants())

But keep your input name in your function when it is declared.
Report Abuse
MXrcr20 is not online. MXrcr20
Joined: 01 Oct 2008
Total Posts: 2644
23 Nov 2013 04:34 PM
Change all occurrences of hit to bla or vice versa.
Report Abuse
coolblox2334 is not online. coolblox2334
Joined: 10 Dec 2010
Total Posts: 4605
23 Nov 2013 05:34 PM
M
I edited that
In the original script, it's all hit.

XD
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