What you will have to do is edit a library script and force that script to load the modified script you made.
One way to do this is to edit the stimecycle.lua which is a library script.
Library scripts are certain scripts that stay loaded all the time in the game.....stimecycle.lua, libplayer.lua, libped.lua, bdorm.lua, main.lua, mainmap.lua and a few others are library scripts.
What you need to do is easy on paper...but in practice it needs a little experimentation to get working properly which all of us lua coders are still figuring out a few odds and ends since the bully lua scripts are not exactly documented at all by rockstar and the only documentation that exists is what I have provided from what I have figured out.
To add a external script to a library script you need to edit at the beginning of a script and add:
ImportScript("ArcRace1.lua")
That line will add the external script which in this case is the Arcade Machine in the boys dorm.
You will also need to launch the external script which has to be done in key parts of the script. This can be launching the script only once or launch it any number of times and it should work.
To launch a imported script you need to use:
LaunchScript("ArcRace1.lua")
This is the arcade machine in the boys dorm as per our example for importing the script.I will paste the STimeCycle.lua script here with the changes and what you need to do is compile the modified STimecycle.lua to STimeCycle.lur and replace the original file. Make backups first of the original file JUST IN CASE since I cannot stress that point enough since backups are a must. If you have the space a complete copy of your installed game folders for bully is the best option since all you have to do then is copy the good files back over the bad files if you make a mistake.
Copy and save the following as STimeCycle.lua and compile it with the bully lua compiler that I uploaded which can be found here:
http://www.bully-board.com/index.php?action=downloads;sa=downfile&id=60To compile it just simply open up a command window by going to your start menu, click run if you have it and type cmd and hit enter. This will open up the command window. Next change to the folder where you extracted the lua compiler....I use the root of my c drive for the lua compiler since it is easy to get to and far faster then trying to type in long folder names and paths. So for example you would type:
cd \ and hit enter which will take you to teh root of C:\ and then type:
luac -o STimeCycle.lua STimeCycle.lur and hit enter. The compiled STimeCycle.lur will appear in the same place that luac.exe was placed. Just simply make a new scripts.img with the new compiled file in it replacing the old file and load up bully and give it a shot.
ImportScript("ArcRace1.lua")
main = function()
repeat
Wait(1000)
until not Alive
end
F_AttendedClass = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
return
end
SetSkippedClass(false)
PlayerSetPunishmentPoints(0)
end
F_MissedClass = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
return
end
SetSkippedClass(true)
StatAddToInt(166)
end
F_AttendedCurfew = function()
if not PedInConversation(gPlayer) and not MissionActive() then
TextPrintString("You got home in time for curfew", 4)
end
end
F_MissedCurfew = function()
if not PedInConversation(gPlayer) and not MissionActive() then
TextPrint("TM_TIRED5", 4, 2)
end
end
F_StartClass = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
return
end
F_RingSchoolBell()
local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
end
F_EndClass = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
return
end
F_RingSchoolBell()
end
F_StartMorning = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndMorning = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartLunch = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
F_UpdateTimeCycle()
return
end
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndLunch = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartAfternoon = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndAfternoon = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartEvening = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndEvening = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartCurfew_SlightlyTired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartCurfew_Tired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartCurfew_MoreTired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_StartCurfew_TooTired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndCurfew_TooTired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_EndTired = function()
F_UpdateTimeCycle()
LaunchScript("ArcRace1.lua")
end
F_Nothing = function()
end
F_ClassWarning = function()
if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
return
end
local l_23_0 = math.random(1, 2)
end
F_UpdateTimeCycle = function()
if not IsMissionCompleated("1_B") then
local l_24_0 = GetCurrentDay(false)
if l_24_0 < 0 or l_24_0 > 2 then
SetCurrentDay(0)
end
end
F_UpdateCurfew()
end
F_UpdateCurfew = function()
local l_25_0 = shared.gCurfewRules
if not l_25_0 then
l_25_0 = F_CurfewDefaultRules
end
l_25_0()
end
F_CurfewDefaultRules = function()
local l_26_0 = ClockGet()
if l_26_0 >= 23 or l_26_0 < 7 then
shared.gCurfew = true
else
shared.gCurfew = false
end
end