it gives me attemot to call a nil value as i press any button, i have no idea why. no line errors eithr
--declare variables
local OnlineButton = script.Parent.Frame.OnlineButton
local StoryButton = script.Parent.Frame.StoryButton
local RandomModeButton = script.Parent.Frame.RandomModeButton
local Console = script.Parent.Frame.Console
local ChosenMode = "Unknown"
local clearToLoad = true
local randomMode = math.random(0,1)
-- variables for check
local check0 = true
local check1 = false
-- initialize components
function render()
clearToLoad = true
Console.TextScaled = true
clear(Console)
init()
end
function clear(text)
text.Text = ""
end
function loadGame()
Console.Text = "No errors yet! :D"
Console.Text = Console.Text .. '\nPlease wait at least 5 seconds for loading \nbefore clicking a button.'
if (OnlineButton == script.Parent.Frame.OnlineButton) then
elseif (check0 == false) then
check0 = true
check()
else
clear(Console)
Console.Text = Console.Text .. "error! unhandeled exception: code 01 - StartupLogic \n"
end
render()
end
function check()
if (StoryButton == script.Parent.Frame.StoryButton) then
elseif (check1 == false) then
check1 = true
render()
else
clear(Console)
Console.Text = Console.Text .. "error! unhandled exception: code 02 - StartupLogic \n"
end
end
function PlayGame(mode, allowAccess, isRandom)
print'connect'
if (mode == "story") then
elseif (game.Workspace.StoryActive == true) then
ChosenMode = "story"
Console.Text = Console.Text .. 'Loading Story Mode... \n'
wait(5)
clear(Console)
else
Console.Text = Console.Text .. 'error! code 03 - StartupLogic \n"storymode not found"'
end
if (mode == "online") then
elseif (game.Workspace.OnlineAvaliable == true) then
ChosenMode = "online"
Console.Text = Console.Text .. 'Loading Ejected Online... \n'
wait(6.5)
clear(Console)
else
Console.Text = Console.Text .. 'error! code 04 -StartupLogic \nOnline servers unavaliable'
end
if (mode == "random") then
elseif (isRandom == true) then
elseif (allowAccess == true) then
elseif (randomMode == 0) then
PlayGame("online", true, false)
elseif (randomMode == 1) then
PlayGame("story", true, false)
else
Console.Text = Console.Text .. "error! code 05 - StartupLogic \nUnknown mode"
wait(8.5)
clear(Console)
end
clear(Console)
end
function noLoadPermissions(Perm)
if (Perm == false) then
Console.Text = Console.Text .. '\nUnable to load! error code 06, something is \n unable to confirm! Contact AlienMister! \n'
wait(8.5)
clear(Console)
loadGame()
end
end
function init()
end
--Now for the code and calling these functions
print 'start'
loadGame()
OnlineButton.MouseButton1Click:connect(PlayGame("online", true, false))
StoryButton.MouseButton1Click:connect(PlayGame("story", true, false))
RandomModeButton.MouseButton1Click:connect(PlayGame("random", true, true))

3 comments
It would certainly help if you told us what line the error was on, indicated by the output.
Remember you can't call functions that were not previously declared. Put the clear function above the render function.
yes but it doesnt give me a line number