Hi! I’m having trouble with this script. It works fine but whenever I enter the numbers 36-99 it won’t pass through and it would just return nothing, am I missing something here?
I can type 1-35 and 100-350 but not 36-99.
Help are appreciated!
local player = game.Players.LocalPlayer
local GUI = player.PlayerGui.FLY_GUI
local TextBox = GUI.MainFrame.TextBox
local CurrentPower = GUI.MainFrame.CurrentPower.TextLabel
local Tool = script.Parent
player:SetAttribute("FlyPower", 50)
CurrentPower.Text = "Current Power: "..player:GetAttribute("FlyPower")
Tool.Equipped:Connect(function()
GUI.Enabled = true
end)
Tool.Unequipped:Connect(function()
GUI.Enabled = false
end)
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
TextBox.Text = TextBox.Text:gsub("%D", "")
end)
TextBox.FocusLost:Connect(function()
if TextBox.Text > tostring(350) or TextBox.Text == tostring(0) then
TextBox.Text = ""
return
end
if TextBox.Text <= tostring(350) then
player:SetAttribute("FlyPower", TextBox.Text)
CurrentPower.Text = "Current Power: "..player:GetAttribute("FlyPower")
end
end)