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 » Scripters
Home Search
 

Re: Changing the X position of a part.

Previous Thread :: Next Thread 
repgainer3 is online. repgainer3
Joined: 31 Mar 2012
Total Posts: 184
22 Jul 2017 01:11 AM
I'm making a script that does this, it takes the string value of a text box, and turns it into an IntValue, then the X position of a part is workspace is supposed to be set to what the IntValue is. the script does set the IntValue to what is typed in, but the parts position never changes, any help?

script.Parent.MouseButton1Click:connect(function()
script.Parent.Value.Value = tonumber(script.Parent.Parent.Parent.ScrollingFrame.TextBox.Text)
wait(0.01)
game.Workspace.Part.Position.X = script.Parent.Value.Value
end)

The output for this when pressed is this.

"X can not be assigned to"
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Jul 2017 01:18 AM
As it says, you cannot assign it.


script.Parent.MouseButton1Click:connect(function()
script.Parent.Value.Value = tonumber(script.Parent.Parent.Parent.ScrollingFrame.TextBox.Text)
wait(0.01)
local y = workspace.Part.Position.Y
local z = workspace.Part.Position.Z
game.Workspace.Part.Position = Vector3.new(script.Parent.Value.Value, x, z)
end)

Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
22 Jul 2017 01:19 AM
game.Workspace.Part.Position = Vector3.new(script.Parent.Value.Value, x, z)

should be

game.Workspace.Part.Position = Vector3.new(script.Parent.Value.Value, y, z)

Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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