generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ######## ######## detector doesnt work

Previous Thread :: Next Thread 
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
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 is not online. DevJoas
Joined: 17 Dec 2014
Total Posts: 627
26 Jul 2017 08:52 AM
This shouldn't be done locally

Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
26 Jul 2017 08:55 AM
Well then how do i fix it ?
Report Abuse
DevJoas is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
26 Jul 2017 09:36 AM
That is server script compatible, though

Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
26 Jul 2017 09:40 AM
Thanks mate!


this is exactly what i needed!
Report Abuse
DevJoas is not online. 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
Bobbybillyhi is not online. Bobbybillyhi
Joined: 10 Apr 2012
Total Posts: 287
26 Jul 2017 11:34 AM
Have you tried building a wall?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image