(SOLVED)dont come here

i want it to print the thing u typed NOT “a”
for e.g
i typed 50
it prints 50
but if i type a it prints nil

local haki = {}

local frame = script.Parent.Parent
local textbutton = frame:WaitForChild("TextButton")
local box = frame:WaitForChild("TextBox")

textbutton.MouseButton1Click:Connect(function()
	if box.Text ~= "a" then
print("nil")
	else
		haki  = box.Text
		print(haki)
	end
end)

startergui>screengui>frame>textbutton>uicorner + textbox>localscript

What does your script not do? Looks like it would work to me

1 Like

Why are you making a table variable equal to a string?

1 Like

it is but i want it to print 10 or whatever number u want but if the textbox is empty and u press the textbutton it prints “nope”

Use string.len to get the length of a string.

local haki

local frame = script.Parent.Parent
local textbutton = frame:WaitForChild("TextButton")
local box = frame:WaitForChild("TextBox")

textbutton.MouseButton1Click:Connect(function()
	if string.len(box.Text) == 0 then
		print("nil")
	else
		haki = box.Text
		print(haki)
	end
end)
1 Like

what does that mean?

if you watched one piece then
im trying to make haki resistant

if you dont watch one piece then
im trying to make a power thing
so if your power is 50 or more then you can withstand the power that the other player used

So what’s wrong with the script

1 Like

i watch una pieza but i am not in that episode, i am at episode 512 what is haki resistant

1 Like

forget everything i said im getting something