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!
I need a script that will check if the TextBox’s text is a number, if so, it will check if the value is bigger then another value. if it isnt, code gets run. Basically the player gets TP’d to a part in a folder inside of workspace. Basically, if you ever played a DCO or obby and you had that one feature where you could change stages back and fourth, im trying to make that. -
What is the issue? Include screenshots / videos if possible!
I get something saying:
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
This the code:
--[[
// Name: Handler.lua
// Author: official_ae#2606
]]
-- Variables
local checkpoints = workspace:WaitForChild("Folder")
local textBox = script.Parent.StageEnter
local textButton = script.Parent.StageTP
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local leaderstats = player:WaitForChild("leaderstats")
local stage = leaderstats:WaitForChild("Stage")
local rootPart = character:WaitForChild("HumanoidRootPart")
-- Functions
textButton.MouseButton1Click:Connect(function()
local stageSelected = textBox
print(player.Name.." clicked")
print(textBox.Text)
if stageSelected.Text > stage.Value then
print("cant tp")
else
rootPart.CFrame = checkpoints:WaitForChild(stageSelected.Text).CFrame + Vector3.new(0,2,0)
end
end)