What do you want to achieve? I want to know why my script is not working.
What is the issue? It is not working and nothing is being said in the output.
What solutions have you tried so far? I have tried to get ChatGPT to fix the script
-- Function to be called if the random number is 1
function fireFunction()
print("The random number is 1! Firing the function.")
game.ServerStorage.Maze.Parent = workspace
end
-- Generate a random number between 1 and 2 (inclusive)
local randomNumber = math.random(1, 2)
-- Display the generated random number
print("Generated random number:", randomNumber)
-- Check if the random number is 1 and call the function if true
if randomNumber == 1 then
fireFunction()
else
print("The random number is not 1.")
end
The script is to, when a certain number is picked, a model named maze will appear in the workspace.
-- Function to be called if the random number is 1
function fireFunction()
print("The random number is 1! Firing the function.")
game.ServerStorage.Maze.Parent = workspace
end
-- Generate a random number between 1 and 2 (inclusive)
local randomNumber = math.random(1, 2)
-- Display the generated random number
print("Generated random number:" ..tostring(randomNumber))
-- Check if the random number is 1 and call the function if true
if randomNumber == 1 then
fireFunction()
else
print("The random number is not 1.")
end
function fireFunction()
print("The random number is 1! Firing the function.")
game.ServerStorage.Maze.Parent = workspace
end
-- Generate a random number between 1 and 2 (inclusive)
local randomNumber = math.random(1, 50)
wait(5)
-- Display the generated random number
print("Generated random number:" ..tostring(randomNumber))
-- Check if the random number is 1 and call the function if true
if randomNumber == 1 then
fireFunction()
else
print("The random number is not 1.")
end