|
| 24 Dec 2011 07:36 AM |
**How would i change this script to unanchor the gui owners torso?**
script.Parent.MouseButton1Click:connect(function () script.Parent.Parent.Parent:Remove() wait(1) end) |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 24 Dec 2011 07:49 AM |
Depends how deep your gui is located.
local torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso
Maybe some more or some less Parent's till you reach the Player, but you gotta find that out. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 07:51 AM |
Ok i will try that
And the rpg script has a problem: Go here:
http://www.roblox.com/Forum/ShowPost.aspx?PostID=60053758&PageIndex=2#60129454 |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 07:54 AM |
> Players.Player.PlayerGui.ShopGui.ShopFrame.CloseShopButton.:3: attempt > to index field 'Parent' (a nil value)
script.Parent.MouseButton1Click:connect(function () script.Parent.Parent.Parent:Remove() local torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso plr = workspace.FindFirstChild(torso) plr.Torso.Anchored = false wait(1) end)
|
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 24 Dec 2011 07:59 AM |
Can you type the whole path where the script is located? (The error only shows a part of it) E.g: StartersGui -> ShopGui -> ... |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 08:12 AM |
| Player - PlayerGui - shopgui-Frame - closebutton - script |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 24 Dec 2011 08:37 AM |
| Move script.Parent.Parent.Parent:Remove() to after torso.Anchored = false |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 08:42 AM |
> Argument 1 missing or nil 14:40:56 - Script > "Players.Player.PlayerGui.ShopGui.ShopFrame.CloseShopButton.", Line 4 > 14:40:56 - stack end 14:40:56 - Disconnected event because of > exception |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 24 Dec 2011 08:47 AM |
Replace
local torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso plr = workspace.FindFirstChild(torso) plr.Torso.Anchored = false
with
local torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso torso.Anchored = false |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 08:51 AM |
| That's that fixed. **Thanks!** |
|
|
| Report Abuse |
|
|