Melee combat LUA

2 replies
13 years, 6 months ago
#6712

I’m using LUA commands to have melee weapons in game (freeride and story). I tried this, but it crashes almost always. What’s wrong with my script?

 

if i==nil then i=0 end i=i+1

if i==5 then i=1 end

if i==1 then

game.game:GetActivePlayer():SetAnimStyle(“melee”,”default”)

game.game:GetActivePlayer():SetAnimStyle(“common”,”default”)

game.game:GetActivePlayer():ModelToHands(true,-1,1) end

if i==2 then

game.game:GetActivePlayer():SetAnimStyle(“melee”,”PendrekStyle”)

game.game:GetActivePlayer():SetAnimStyle(“common”,”ManColdWeapon”)

game.game:GetActivePlayer():ModelToHands(true,-1,28) end

if i=smile3.gif then

game.game:GetActivePlayer():SetAnimStyle(“melee”,”BatStyle”)

game.game:GetActivePlayer():SetAnimStyle(“common”,”ManColdWeapon”)

game.game:GetActivePlayer():ModelToHands(true,-1,32) end

if i==4 then

game.game:GetActivePlayer():SetAnimStyle(“melee”,”KnifeStyle”)

game.game:GetActivePlayer():SetAnimStyle(“common”,”ManColdWeapon”)

game.game:GetActivePlayer():ModelToHands(true,-1,22) end

 

 

 

P.S. I know about melee weapons in Existenz34’s freeride, but I use a different one.

13 years, 6 months ago
#14401

jaca37

 

it different styles (“melee”,”…”) and (“common”,”…”)

and else in game should stand modified file “ingame”

if i==nil then i=0 end

DelayBuffer:Insert(function(l_1_0)i=i+1 if i==5 then i=1 end

if i==1 then game.game:GetActivePlayer():ModelToHands(true,1,1)

game.game:GetActivePlayer():SetAnimStyle(“melee”,”default”)end

if i==2 then game.game:GetActivePlayer():ModelToHands(true,1,28)

game.game:GetActivePlayer():SetAnimStyle(“melee”,”PendrekStyle”)end

if i=smile3.gif then game.game:GetActivePlayer():ModelToHands(true,1,32)

game.game:GetActivePlayer():SetAnimStyle(“melee”,”BatStyle”)end

if i==4 then game.game:GetActivePlayer():ModelToHands(true,1,22)

game.game:GetActivePlayer():SetAnimStyle(“melee”,”KnifeStyle”)end

end,{l_1_0},100,1,false)

13 years, 6 months ago
#14403

Thanks, I already modified ingame file to have more melee styles.

  • You must be logged in to reply to this topic.