jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:08 PM |
This is supposed to do all the block in the middle when the brick is click...but it not working, help?
touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(workspace.Conveyor1.Position+Vector3.new(0, 2, 0)) player.Playing.Value=true connection=player.Character.Humanoid.Died:connect(function() die(player) end) occupied=true script.Parent.BrickColor=BrickColor.new("Bright red") end script.Parent.Teleport.ClickDetector.MouseClick:connect(touch)
|
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 03:10 PM |
function touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then -- What is occupied? player=game.Players:playerFromCharacter(hit.Parent) theplayer=player -- What's the point of this line? player.Character:MoveTo(workspace.Conveyor1.Position+Vector3.new(0, 2, 0)) player.Playing.Value=true connection=player.Character.Humanoid.Died:connect(function() die(player) end) -- what? occupied=true -- what? script.Parent.BrickColor=BrickColor.new("Bright red") end end -- missed this for the first function. script.Parent.Teleport.ClickDetector.MouseClick:connect(touch) |
|
|
| Report Abuse |
|
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:11 PM |
LOL thanks man. Oh and I know the block works, I am just editing it. I used it as a touch, but I am making it a click now...
~Lets talk when you get more money than me! |
|
|
| Report Abuse |
|
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:13 PM |
Yeah, I did this earlier, and it didnt work. Still isnt. :/
~Lets talk when you get more money than me! |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 03:14 PM |
| I didn't change it. I added things you need to fix. I am helping you learn. |
|
|
| Report Abuse |
|
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:14 PM |
This is what it was before I am doing the update, and now the code wont work. This block down here \/ works.
function touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(workspace.Conveyor5.Position+Vector3.new(0, 2, 0)) player.Playing.Value=true connection=player.Character.Humanoid.Died:connect(function() die(player) end) occupied=true script.Parent.BrickColor=BrickColor.new("Bright red") end end script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
| |
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:23 PM |
It is a variable.
~Lets talk when you get more money than me! |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 03:26 PM |
It is not defined by the second line. So, of course it will error. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 03:27 PM |
local occupied = false function touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(workspace.Conveyor5.Position+Vector3.new(0, 2, 0)) player.Playing.Value=true connection=player.Character.Humanoid.Died:connect(function() die(player) end) occupied=true script.Parent.BrickColor=BrickColor.new("Bright red") end end script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:27 PM |
I have lines previous of this....
occupied=false oldcolor=script.Parent.BrickColor theplayer=nil
function touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(workspace.Conveyor5.Position+Vector3.new(0, 2, 0)) player.Playing.Value=true connection=player.Character.Humanoid.Died:connect(function() die(player) end) occupied=true script.Parent.BrickColor=BrickColor.new("Bright red") end end script.Parent.Touched:connect(touch)
|
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 03:31 PM |
function touch(hit) if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then occupied=true player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(Vector3.new(game.Workspace.Conveyor5.Position.x,game.Workspace.Conveyor5.Position.y + 2,game.Workspace.Conveyor5.Position.z)) player.Playing.Value=true script.Parent.BrickColor=BrickColor.new("Bright red") occupied = false end end script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
jerryg225
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 23187 |
|
|
| 09 Oct 2012 03:37 PM |
That doesnt work, I and I dont know why.
function touch(hit) --Can I even add a parameter here? Is that throwing it off? if (game.Players:playerFromCharacter(hit.Parent)~=nil) and not occupied then occupied=true player=game.Players:playerFromCharacter(hit.Parent) theplayer=player player.Character:MoveTo(Vector3.new(game.Workspace.Conveyor5.Position.x,game.Workspace.Conveyor5.Position.y + 2,game.Workspace.Conveyor5.Position.z)) player.Playing.Value=true script.Parent.BrickColor=BrickColor.new("Bright red") occupied = false end end script.Parent.Touched:connect(touch) |
|
|
| Report Abuse |
|
|
| |
|