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: what is wrong with this script

Previous Thread :: Next Thread 
bansheebeanz is not online. bansheebeanz
Joined: 16 Aug 2011
Total Posts: 22
23 Jun 2012 06:22 PM
game.workspace.part = (ontouched) cancollide = false
game.workspace.part = (ontouched) transparency = 1
game.workspace.part = (ontouched) cancollide = true
game.workspace.part = (ontouched) transparency = 0

i need to kno whats wrong this is my first script without a tutorial and i need help dont make fun of my lack of skill
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
23 Jun 2012 06:24 PM
Umm... WOAH... You need to visit the wiki broski...


Working script:

local p = game.Workspace.Part

function OnTouched()
p.Anchored = true
p.CanCollide = false
p.Transparency = 1
wait(4) -- Change 4 to whatever number you want.
p.CanCollide = true
p.Transparency = 0
end
game.Workspace.Part.Touched:connect(OnTouched)
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
23 Jun 2012 06:26 PM
uh learn about functions and events.
Then you will understand how to do this.
Report Abuse
bansheebeanz is not online. bansheebeanz
Joined: 16 Aug 2011
Total Posts: 22
23 Jun 2012 06:28 PM
wow thx this actually makes sense to me
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
23 Jun 2012 06:28 PM
@zack
I don't think that will work becuase the .Touched event take 1 argument/variable.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
23 Jun 2012 06:29 PM
@Above why don't you test it then tell me. 'Cuz last time I checked this worked.
._.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
23 Jun 2012 06:34 PM
That works. But if you want it to work only when a Player touches it you have to add things to check for Humanoid in whatever touches it.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
23 Jun 2012 07:19 PM
Oh yeahh... Forgot about that White...


function OnTouched(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local p = Workspace.Part
p.Anchored = true
p.CanCollide = false
p.Transparency = 1
wait(4) -- Change 4 to whatever number...
p.CanCollide = true
p.Transparency = 0
end
end
game.Workspace.Part.Touched:connect(OnTouched)
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