Bully-Board
Bully Modding Section => Script Modding => Topic started by: Unknownsoldier on January 29, 2015, 07:20:50 PM
-
This function will allow you the attack prefects, not get red meter, and also be able to have the prefects FIGHT back at the player(instead of busting), when the player is attacking:
function F_CantBeBusted(F_CantBeBusted_max001, F_CantBeBusted_isRunning001)
Wait(0)
repeat
local pedG = PedGetGrappleTargetPed(gPlayer)
if PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 0 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 7 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 8 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 9 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 10 then
PedSetActionNode(PedGetGrappleTargetPed(gPlayer), "/Global/1_02/ShortIdle", "Act/Conv/1_02.act")
PedSetActionNode(gPlayer, "/Global/1_02/ShortIdle", "Act/Conv/1_02.act")
PedSetFaction(PedGetGrappleTargetPed(gPlayer),6)
Wait(1)
PedSetActionNode(gPlayer,"/Global/Player","Act/Player.act")
elseif PlayerGetPunishmentPoints() > F_CantBeBusted_max001then
PlayerSetPunishmentPoints(F_CantBeBusted_max001)
end
Wait(0)
until not F_CantBeBusted_isRunning001
end
Here is how to make it work in your mod:
This function should only be called once in your script instead of repeating.
Simply, Copy&Paste the function into an empty space in your script, then, in a function that only runs once(eg. MissionSetup, main, F_MissionSetup etc.), use these perimeters:
F_CantBeBusted(Max_Trouble_Points, true)
Replace "Max_Trouble_Points" with the highest amount of points YOU want it to go to. Here is an example of it being used in a script:
function MissionSetup()
AreaTransitionXYZ(0, 270, -110, 7)
PlayerSetHealth(500)
end
function MissionCleanup()
collectgarbage()
end
function main()
F_CantBeBusted(200, true)
gMissionRunning = true
while gMissionRunning do
Wait(0)
end
end
function F_CantBeBusted(F_CantBeBusted_max001, F_CantBeBusted_isRunning001)
Wait(0)
repeat
local pedG = PedGetGrappleTargetPed(gPlayer)
if PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 0 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 7 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 8 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 9 or PedGetFaction(PedGetGrappleTargetPed(gPlayer)) == 10 then
PedSetActionNode(PedGetGrappleTargetPed(gPlayer), "/Global/1_02/ShortIdle", "Act/Conv/1_02.act")
PedSetActionNode(gPlayer, "/Global/1_02/ShortIdle", "Act/Conv/1_02.act")
PedSetFaction(PedGetGrappleTargetPed(gPlayer),6)
Wait(1)
PedSetActionNode(gPlayer,"/Global/Player","Act/Player.act")
elseif PlayerGetPunishmentPoints() > F_CantBeBusted_max001then
PlayerSetPunishmentPoints(F_CantBeBusted_max001)
end
Wait(0)
until not F_CantBeBusted_isRunning001
end
Note that I used "200" as max, because 200 points is RIGHT before red.
-
You should make it run on it's own thread, so it won't hold up the rest of the script.
-
What file is this and what tool did you use?
-
As far as I know,LUA can be done through NotePad(or more advanced programs like it)I think C+++ as well
If I'm wrong correct me please
-
What file is this and what tool did you use?
STimeCycle
As far as I know,LUA can be done through NotePad(or more advanced programs like it)I think C+++ as well
If I'm wrong correct me please
Most modders here(along with myself) use Notepad++.
-
Close enough.
-
Close enough.
yea lol
-
İ will use it in future
-
You should make it run on it's own thread, so it won't hold up the rest of the script.
I dunno how to call a thread with arguments/perimeters. :blank: