|
| 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 |
|
|
|
| 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 |
|
|
|
| 23 Jun 2012 06:26 PM |
uh learn about functions and events. Then you will understand how to do this. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 06:28 PM |
wow thx this actually makes sense to me
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2012 06:28 PM |
@zack I don't think that will work becuase the .Touched event take 1 argument/variable. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|