|
| 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 |
|
|
|
| 29 Mar 2014 05:15 PM |
| Where is the script located? |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 06:07 PM |
| The script is in the workspace. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Mar 2014 08:49 PM |
| Woops, I meant it was in a part. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 30 Mar 2014 07:26 AM |
| script.Parent.Touched:connect(function(hit))*** |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|