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
 

How do I make this script work?

Previous Thread :: Next Thread 
Avocation is not online. Avocation
Joined: 22 Mar 2011
Total Posts: 107
28 Sep 2014 09:09 PM
I have been trying to make this script work

I have a bunch of number values for the XYZ thing and I have a script that sets the X,Y,Z number values every 10 seconds.

What am I doing wrong?

local player = script.Parent.Parent.Parent

local xyz = player.XYZPos

local xval = xyz.X.Value
local yval = xyz.Y.Value
local zval = xyz.Z.Value

function onClicked()
player.Character.Torso.CFrame = CFrame.new(xval, yval, zval)
end

script.Parent.Button.MouseButton1Down:connect(onClicked)
Report Abuse
Cawlonee is not online. Cawlonee
Joined: 03 Mar 2014
Total Posts: 2687
28 Sep 2014 09:19 PM
XYZ Isn't a member of a player.

I can't tell what you're trying to do.

In order to get the player's Position, do:

pos = player.Character.Torso.Position

local xval = pos.X
local yval = pos.Y
local zval = pos.Z
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