r = Workspace.Rooms
chance = 1
wait(3)

function randomize()
	--Blah blah
end

function close(door)
	--Unimportant
end

function open(door)
	--Yup
end

while wait(math.random(4,9)) do
	randomize() --Crashes when this is called?
end

The script (Not a local script) is located in ServerScriptService. The code above is whats written inside, the problem is that the moment randomize() is called, it gives an error : 15:04:47.675 - ServerScriptService.MainScript:4: attempt to call global 'randomize' (a nil value) 15:04:47.676 - Stack Begin 15:04:47.676 - Script 'ServerScriptService.MainScript', Line 4 15:04:47.677 - Stack End

1 comment

0

What is the body of randomize function?