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: [HELP] script not working

Previous Thread :: Next Thread 
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
23 Jul 2017 04:16 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent==game.Players.LocalPlayer.Character then
if not hit.Parent==game.Players.LocalPlayer.Character.UpperTorso then
if not hit.Parent==game.Players.LocalPlayer.Character.LowerTorso then
if not hit.Parent==game.Players.LocalPlayer.Character.Head then
wait(2)
hit:Destroy()
end
end
end
end
end)

This script does not work, i checked the dev console and nothing was in it


Any help would be appreciated

Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 04:21 PM
You can't have localscripts as descendants of workspace.
Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
23 Jul 2017 04:35 PM
What do you mean? i cant have localplayer in a script that is on workspace?
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 04:37 PM
Indeed you can't. In words, what are you trying to do?
Report Abuse
HeIix is not online. HeIix
Joined: 19 Jan 2013
Total Posts: 253
23 Jul 2017 04:37 PM
localplayer can only be accessed through localscripts, not scripts. LocalScripts can't run in the workspace


‍ ‍ ‍                                            ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
23 Jul 2017 04:50 PM
Once you touch the brick, that part of the brick that touched it gets destroyed, but the torso, and the head cannot get destroyed.
Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
23 Jul 2017 04:50 PM
Oh, okay what do i do then ?
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Jul 2017 04:56 PM
script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if hit.Name ~= "UpperTorso" and hit.Name ~= "LowerTorso" and hit.Name ~= "Head" then
wait(2)
hit:Destroy()
end
end
end)
Report Abuse
PriorityMethod is not online. PriorityMethod
Joined: 17 Sep 2013
Total Posts: 356
23 Jul 2017 04:57 PM
Hmm sorry but this is simple..
Report Abuse
MrArabMayHam is not online. MrArabMayHam
Joined: 17 Feb 2016
Total Posts: 31
23 Jul 2017 05:21 PM
IK i only just started learning..
Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
24 Jul 2017 11:57 AM
Use:

game.workspace.Part.Touched:connect(function(stuff)


end)

and put it in StarterGui.
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