|
| 26 Jul 2017 08:51 AM |
script.Parent.Touched:connect(function(h) if h==game.Players.LocalPlayer.Character.Arstotzka then game.Players.LocalPlayer.Character.Arstotzka:Destroy() wait() game.Players.LocalPlayer.Character.Humanoid.Health=50 end end)
This script does not work, could someone write a solution in the replies
Thanks! |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 26 Jul 2017 08:52 AM |
This shouldn't be done locally
|
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 08:55 AM |
| Well then how do i fix it ? |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 26 Jul 2017 08:56 AM |
Check for the touch server sided.
Are you sure Arstotzka is a child of Player.Character? |
|
|
| Report Abuse |
|
|
sonihi
|
  |
| Joined: 27 Jun 2009 |
| Total Posts: 3655 |
|
|
| 26 Jul 2017 09:00 AM |
okay ma man i will give you a solution
script.Parent.Touched:connect(function(h) if game.Players:GetPlayerFromCharacter(h.Parent) then local Player=game.Players:GetPlayerFromCharacter(h.Parent) if Player.Character:FindFirstChild("Arstotzka") then Player.Character.Arstotzka:Destroy() wait() game.Players.LocalPlayer.Character.Humanoid.Health=50 end end end) |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 26 Jul 2017 09:02 AM |
| ^ Don't think thats what OP is looking for |
|
|
| Report Abuse |
|
|
sonihi
|
  |
| Joined: 27 Jun 2009 |
| Total Posts: 3655 |
|
|
| 26 Jul 2017 09:05 AM |
o yeah i made a mistake
script.Parent.Touched:connect(function(h) if game.Players:GetPlayerFromCharacter(h.Parent) then local Player=game.Players:GetPlayerFromCharacter(h.Parent) if Player.Character:FindFirstChild("Arstotzka") then Player.Character.Arstotzka:Destroy() wait() Player.Character.Humanoid.Health=50 end end end) |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 26 Jul 2017 09:09 AM |
| But this has to be in a server script, not in a local script. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 09:36 AM |
That is server script compatible, though
|
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 09:40 AM |
Thanks mate!
this is exactly what i needed! |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 26 Jul 2017 11:22 AM |
@ ExtremeBuilder15
I know, but I wasn't sure if OP understood he had to put it in a server script instead of a local script. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 11:34 AM |
| Have you tried building a wall? |
|
|
| Report Abuse |
|
|