|
| 13 Apr 2017 07:54 AM |
arena = game.Workspace.PVP player = ????
arena.Touched:connect(function() player.CanDamage.Value = true end) arena.TouchEnded:connect(function() player.CanDamage.Value = false end)
|
|
|
| Report Abuse |
|
|
Nitro509
|
  |
| Joined: 27 Jun 2010 |
| Total Posts: 11170 |
|
|
| 13 Apr 2017 09:34 AM |
Depends on the properties you're trying to use.
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 13 Apr 2017 09:36 AM |
part.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then -- do your stuff end end)
|
|
|
| Report Abuse |
|
|
|
| 13 Apr 2017 09:36 AM |
If it's a server sided script, you can use a for loop to loop through all the players and fire code to the player that is inside the for loop.
else just use LocalPlayer |
|
|
| Report Abuse |
|
|
causati0n
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 235 |
|
|
| 13 Apr 2017 09:36 AM |
arena = game.Workspace.PVP
arena.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.CanDamage = true end end) arena.TouchEnded:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then player.CanDamage = true end end)
|
|
|
| Report Abuse |
|
|
causati0n
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 235 |
|
| |
|
|
| 13 Apr 2017 09:37 AM |
| Also wrath's code is better. |
|
|
| Report Abuse |
|
|
| |
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 13 Apr 2017 09:39 AM |
ninja'd :D
our code is pretty much the same, the difference is he did op's work for him and i just showed op how to do it
|
|
|
| Report Abuse |
|
|