|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|