im trying to make a for loop where one of the values is the text from a texbutton gui problem is, it says forloops can only take number values is there any way to fix this? i type numbers into the text button, but it still does not work
code:
wait(1)
local player = script.Parent.Parent.Parent.Parent
local Mouse = player:GetMouse()
script.Parent.Parent.Parent.Start.StartButton.MouseButton1Click:connect(function(click)
wait(1)
for i = script.Parent.Parent.Parent.Objects.Object.Position,script.Parent.Text,.1 do
script.Parent.Parent.Parent.Objects.Object.Position = script.Parent.Parent.Parent.Objects.Object.Position + UDim2.new(0,0,0,i)
wait(.5)
end
end)

10 comments
You can use numbers. If it's not letting you, you're doing something wrong.
you wanna bet?
Players.wookey12.PlayerGui.ScreenGui.TextBox.Script:6: 'for' initial value must be a num
That's a code error you have there. If it's troubling you, post a new question regarding it.
i added the code, do i have an error?
http://wiki.roblox.com/index.php?title=String#Converting_a_string_to_a_number
@TheeDeathCaster so i didn't make an error? thank you!
uhh it would be tonumber("script.Parent.Text") right? if it is, it didn't work. maybe it has to do with the position?
No. doing "script.Parent.Text" is what it is actually trying to become, not the text in the textbox.
@hiimgoodpack that's what the textbox is though....... the script is parented in the textbox if i say script.Parent.Text, it means the text in textbox...