Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does anyone know why my return script isn't working I've tried every method please help?

I was making my code but when I finished I checked everything and made sure the was no errors and I was watching tutorials on YouTube on how to fix this script if you know please help me What do I have to do to make this script run propely?

Here the script:

function hello()
print ("hi")
print ("hi")
return (10)
end
hello()

1 comment

0

What do you think return does?

2 answers

✓ Accepted answer

What do you need to return? Do you want to print 10, after printing 'hi' twice?

And you need to put local in front of the function.

local function hello()

	print ("hi")

	print ("hi")

	return (10)

end

print(hello())

--[[ Output:

hi
hi
10

]]--

2 comments

0

So in every function do you have to have the word "local" and in every variable?

0

yes, unless you are doing a module script. But don't get into that yet.

This repeats it.

on = true
-----------------
if script.Disabled == false then
	repeat
		print("Hello")
		wait(1)
	until
	script.Disabled == true
end

This is what disables the script after ten seconds.

wait(10)
script.Disabled = true

You could also do this and it'll pop up with a number next to it to tell you which one it is instead of the x2.

for hello = 1,10,1 do
	print("Hi",hello)
	wait(0.5)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.