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: newbie scripted needs help

Previous Thread :: Next Thread 
XTGNecro is not online. XTGNecro
Joined: 26 Oct 2008
Total Posts: 18514
26 May 2014 06:58 PM
I'm trying to make a brick (called part) have it's Reflectance value become 1, then change back to 0 after 2 seconds
Nothing happens when I touch it

local Part = Workspace.Part

function onTouch(part)
brick.Reflectance = 1
wait(2)
brick.Reflectance=0

end

Part.Touched:connect (onTouch)
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
26 May 2014 07:11 PM
Delete the space between the ( and connect

Part.Touched:connect(onTouch)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
26 May 2014 07:28 PM
The space doesn't matter
The problem is you set a variable to Part and tried to change brick
The script doesn't know what brick is
Report Abuse
golfercab is not online. golfercab
Joined: 26 Sep 2011
Total Posts: 714
26 May 2014 08:06 PM
game.Workspace.Part
Report Abuse
golfercab is not online. golfercab
Joined: 26 Sep 2011
Total Posts: 714
26 May 2014 08:07 PM
Yeh I would change the name of the part also or put the script inside the part and refer to it as script.Parent
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
26 May 2014 08:13 PM
local Part = Workspace.Part

function onTouch(part)
Part.Reflectance = 1
wait(2)
Part.Reflectance=0

end

Part.Touched:connect (onTouch)


That works, but you should add a debounce.
Report Abuse
golfercab is not online. golfercab
Joined: 26 Sep 2011
Total Posts: 714
26 May 2014 11:06 PM
^ sounds good

Since when did roblox make it Workspace.(part) instead of game.Workspace?
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
26 May 2014 11:24 PM
Forever?
Report Abuse
donatepls is not online. donatepls
Joined: 19 Apr 2013
Total Posts: 56
27 May 2014 12:34 AM
I don't remember ever having to use "game.Workspace". Sure, it works, but what's the point of typing an extra word?
Report Abuse
SolarHorizon is not online. SolarHorizon
Joined: 22 Jun 2010
Total Posts: 633
27 May 2014 01:30 AM
i dont know but got used to doing it
Report Abuse
Qeary is not online. Qeary
Joined: 27 Jun 2013
Total Posts: 5401
27 May 2014 02:05 AM
local Part = game.Workspace.Part

function onTouch(part)
brick.Reflectance = 1
wait(2)
brick.Reflectance = 0

end
Part.Touched:connect (onTouch)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
27 May 2014 02:06 AM
@Qeary
No
Report Abuse
JoBruin is not online. JoBruin
Joined: 19 Feb 2012
Total Posts: 5092
27 May 2014 02:12 AM
Lol worth a try
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