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: Getting a players torso from a gui?

Previous Thread :: Next Thread 
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
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 is not online. 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
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
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
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
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 is not online. 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
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
24 Dec 2011 08:12 AM
Player - PlayerGui - shopgui-Frame - closebutton - script
Report Abuse
dennisvdz is not online. 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
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
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 is not online. 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
stuart6854 is not online. stuart6854
Joined: 20 Oct 2008
Total Posts: 913
24 Dec 2011 08:51 AM
That's that fixed. **Thanks!**
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