You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Turn a TextBox.Text Into A Number
What is the issue? Include screenshots / videos if possible!
It Wont Let Me Do IT
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Ive Tried Tonumber Yet It Dosent Work
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that itâs easier for people to help you!
local TextBox = script.Parent.Parent.TextBox
local Power = 0
local Spin = 0
local Step = 1
local Deb = true
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
TextBox.Text = TextBox.Text:gsub('%D+', '');
end)
script.Parent.Activated:Connect(function()
if Deb == true then
if Step == 1 then
Power = TextBox.Text
Step = 2
script.Parent.Parent.Text = "Spin"
TextBox.Text = "0"
else
Spin = TextBox.Text
Step = 1
Deb = false
script.Parent.Parent.Text = "Power"
TextBox.Text = "0"
game.ReplicatedStorage.BowlingActive:FireServer(Power, Spin, game.Players.LocalPlayer)
end
wait(5)
Deb = true
end
end)
This Is A Local Script Btw
Please do not ask people to write entire scripts or design entire systems for you. If you canât answer the three questions above, you should probably pick a different category.
local TextBox = script.Parent.Parent.TextBox
local Power = 0
local Spin = 0
local Step = 1
local Deb = true
TextBox:GetPropertyChangedSignal(âTextâ):Connect(function()
TextBox.Text = TextBox.Text:gsub(â%D+â, ââ);
end)
script.Parent.Activated:Connect(function()
if Deb == true then
if Step == 1 then
Power = TextBox.Text
Step = 2
script.Parent.Parent.Text = âSpinâ
TextBox.Text = â0â
else
Spin = TextBox.Text
Step = 1
Deb = false
script.Parent.Parent.Text = âPowerâ
TextBox.Text = â0â
game.ReplicatedStorage.BowlingActive:FireServer(tonumber(Power), tonumber(Spin), game.Players.LocalPlayer)
end
wait(5)
Deb = true
end
end)
i have that and it gives me this error with this print 18:46:07.538 ServerScriptService.BowlingMain:4: attempt to concatenate Instance with string - Server - BowlingMain:4
and the print is print(PlayerâŚâPlayerâ) i just figured out that its because i need player.name Tysm