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: I'm having a derp moment and need some help

Previous Thread :: Next Thread 
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
13 Nov 2011 10:53 AM
q.Parent.Parent.Character.Torso.CFrame = CFrame.new(Vector3.new(-99, 7, 23))

I get an error saying Parent is a nil value

q is a screengui object inside of Player.PlayerGui

- HIDE the EGG. Dube.
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
13 Nov 2011 10:57 AM
Why don't you just use a LocalScript for Gui's?
Report Abuse
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
13 Nov 2011 10:58 AM
This is a localscript

- HIDE the EGG. Dube.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
13 Nov 2011 10:59 AM
game.Players.LocalPlayer.Character:MoveTo(Vector3.new(0,0,0))
then
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
13 Nov 2011 11:00 AM
Then why don't you just use:

local owner = game:GetService("Player").LocalPlayer -- in the begin of the script

And then use it later on for other things, such a your script;

owner.Character.Torso.CFrame = CFrame.new(65,876,96) -- you don't need Vector3
Report Abuse
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
13 Nov 2011 11:00 AM
asdf what a fail

I'd written

q:Remove()

before that line

- HIDE the EGG. Dube.
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
13 Nov 2011 11:05 AM
Lol. But you should really use LocalScripts for Gui's:

 - Has more features such as Camera acces.
 - Has a shortcut LocalPlayer (if you define this in the begin of the script then that'll safe up a lot of typing and more)
 - Doesn't need to be (un-)Disabled after/before parenting and if something goes wrong (or you forgot this) it won't error unlike normal Scripts.
 - A gui is always seen if they are in a player, and therefore the script will also only work if it can (is seen), less memory useage.
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