multrimax
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 10294 |
|
|
| 12 Nov 2013 06:44 PM |
playerTeleport = script.Parent.Parent.Parent.Parent.Parent part = game.Workspace.LevelOne.LevelTwoAccess
touching = false function didTouch(part) if part:IsDescendantOf(game.Players.LocalPlayer.Character) then touching = true end end part.Touched:connect(didTouch)
function didNotTouch(part) if part:IsDescendantOf(game.Players.LocalPlayer.Character) then touching = false end end
part.Touched:connect(didNotTouch)
function Teleport(Hit) if touching then playerTeleport.Character.Torso.CFrame = CFrame.new(109, 5.5, 12) end end
script.Parent.MouseButton1Down:connect(Teleport)
Any reason why this script won't work? |
|
|
| Report Abuse |
|
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
| |
|
multrimax
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 10294 |
|
|
| 12 Nov 2013 06:59 PM |
| What it does is that when a player touches a brick, they are allowed to click a TextButton they weren't allowed to click before. It works, but when the player dies, they have to touch the brick again, but I don't want that to happen. Nothing comes out the output. |
|
|
| Report Abuse |
|
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 12 Nov 2013 07:01 PM |
Ah, okay. Well there's two ways you can go about this:
1. Make a value inside each player and check to see if it's true whenever they die. You'd change this value to true once they clicked the button
2. Make a table that contains a list of players that have clicked the button and check the table for the player's name every time they die. |
|
|
| Report Abuse |
|
|
multrimax
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 10294 |
|
|
| 12 Nov 2013 07:04 PM |
| And how would I do the first one? Sorry, I'm fairly new to scripting. |
|
|
| Report Abuse |
|
|