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 » Scripting Helpers
Home Search
 

Re: Help with touched script

Previous Thread :: Next Thread 
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
29 Mar 2014 05:10 PM
I have a script I made which deletes 3 guis when it is touched. For some reason it will not delete the guis.


script.Parent.Touched:connect(function(hit)
plr = game.Players:findFirstChild(hit.Parent.Name)
if plr then
game.Players.LocalPlayer.PlayerGui.Intro:remove()
game.Players.LocalPlayer.PlayerGui.welcome:remove()
game.Players.LocalPlayer.PlayerGui.continue:remove()
end
end)


Please help. Thank you :)

P.S. It is in a LocalScript
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
29 Mar 2014 05:15 PM
Where is the script located?
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
29 Mar 2014 06:07 PM
The script is in the workspace.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:20 PM
Dude why the heck is it a LocalScript. It won't work unless it is in players backpack PlayerGui or character. Make it a regular, and change game.Players.LocalPlayer to plr
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:21 PM
Also if it is in workspace, script.Parent.Touched means if workspace is touched. Put the script in the part.
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
29 Mar 2014 08:49 PM
Woops, I meant it was in a part.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Mar 2014 04:03 AM
Let me repeat


warspyking;

Dude why the heck is it a LocalScript. It won't work unless it is in players backpack PlayerGui or character. Make it a regular, and change game.Players.LocalPlayer to plr
Report Abuse
uyoyalt is not online. uyoyalt
Joined: 16 Apr 2013
Total Posts: 2860
30 Mar 2014 06:34 AM
You don't even call your variable plr, instead you call LocalPlayer.

script.Parent.Touched:connect(function(hit)
plr = game.Players:findFirstChild(hit.Parent.Name)
if plr then
plr.PlayerGui.Intro:remove()
plr.welcome:remove()
plr.continue:remove()
end
end)
Report Abuse
LoveableGirlXD is not online. LoveableGirlXD
Joined: 18 Feb 2014
Total Posts: 429
30 Mar 2014 07:26 AM
script.Parent.Touched:connect(function(hit))***
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
30 Mar 2014 08:46 AM
no. ^

#nerdsunited
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Mar 2014 09:08 AM
I fixed a script you made which deletes 3 guis when it is touched. Obviously it will delete the guis.


script.Parent.Touched:connect(function(hit)
plr = game.Players:findFirstChild(hit.Parent.Name)
if plr then
plr.PlayerGui.Intro:remove()
plr.PlayerGui.welcome:remove()
plr.PlayerGui.continue:remove()
end
end)


I helped. Your welcome :)

P.S. It is in a regular script
Report Abuse
testdummy5000 is not online. testdummy5000
Joined: 04 Jun 2010
Total Posts: 818
30 Mar 2014 12:33 PM
Yes war. I know. I went to bed so I didn't get a chance to say thank you. I know I forgot that it would not work in a local script. Thank you.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Mar 2014 12:35 PM
Welcome
Report Abuse
uyoyalt is not online. uyoyalt
Joined: 16 Apr 2013
Total Posts: 2860
30 Mar 2014 07:43 PM
@war, I'm the first one who post the right script.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Mar 2014 07:46 PM
Yea, I posted his mistake though. I just got bored and posted it. For all I know, you got your script from my answer!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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