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: why does this funciton not work?

Previous Thread :: Next Thread 
zeon23445 is not online. zeon23445
Joined: 25 Jan 2009
Total Posts: 609
13 Jun 2013 10:14 AM
function BrickEffect(Arg1, Arg2, Arg3, Arg4)
brick = game.Workspace:FindFirstChild(Arg1)
if Arg2 == Touch then
local bin = brick
function onTouched(part)
wait(.001)
if Arg3 == Color and Arg4 == Random then
bin.BrickColor = BrickColor.random("")
end
if Arg3 == Color then
bin.BrickColor = BrickColor.new(Arg4)
end
bin.Touched:connect(onTouched)
end
end
end
BrickEffect("Testing", Touch, Color, Random)

i dont get why it wont work. can soemone help me out?
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
13 Jun 2013 10:28 AM
Unless
Touch, Color, Random

are meant to be some sorts of enums, they should probably be replaced with quotes.
Either that, or replace the arguments with booleans:


function BrickEffect(Arg1, Touch, Color, Random)
brick = game.Workspace:FindFirstChild(Arg1)
if Touch then
local bin = brick
function onTouched(part)
wait(.001)
if Color and Random then
bin.BrickColor = BrickColor.random("")
end
if Color then
bin.BrickColor = BrickColor.new(Arg4)
end
bin.Touched:connect(onTouched)
end
end
end
BrickEffect("Testing", true, true, true)
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
13 Jun 2013 10:28 AM
Touch, Color, and Random are undefined variables.
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