- This topic has 4 replies, 3 voices, and was last updated 13 years, 8 months ago by .
Multiple models under one script.
Hi, it is this.
You can change the player model anytime, anywhere.
100% working.
ply=game.game:GetActivePlayer()
if i==nil then i=0 end i=i+1 if i==13+1 then i=1 end
DelayBuffer:Insert(function(l_1_0)if i==1 then game.game:ChangePlayerModel(“vitarmy”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==2 then game.game:ChangePlayerModel(“vitksl2”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i=
then game.game:ChangePlayerModel(“vitnah_t”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==4 then game.game:ChangePlayerModel(“vitoveral”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==5 then game.game:ChangePlayerModel(“vitspo”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==6 then game.game:ChangePlayerModel(“vittel”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==7 then game.game:ChangePlayerModel(“vitukl”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==8 then game.game:ChangePlayerModel(“vitvez”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==9 then game.game:ChangePlayerModel(“vitvop”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==10 then game.game:ChangePlayerModel(“vitvov”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==11 then game.game:ChangePlayerModel(“vitvov2i”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==12 then game.game:ChangePlayerModel(“vitvov3”)end end,{l_1_0},250,1,false)
jaca37
DelayBuffer:Insert & CommandBuffer:Insert for one commande is not necessary.
in FR Script for change player model this is sufficient.
game.game:ChangePlayerModel(“Name_model”)
But the game crashes when using injector with direct control of this type.
that’s why we use a delay.
DelayBuffer:Insert(function(l_1_0) xxxxx
end,{l_1_0},250
,1
,false)
xxxxx
= your command
250
= delay (millisecond) before activation of the command
1
= number of times to repeat the fonction
Test to understand the function “DelayBuffer”:
DelayBuffer:Insert(function(l_1_0)game.game:SaveGame(1) end,{l_1_0},10000
,10
,false)
a backup is performed every 10
second (10000 milli) for10
times.
So in the end, we have.
DelayBuffer:Insert(function(l_1_0)game.game:ChangePlayerModel(“Name_model”)end,{l_1_0},250,1,false)
and for “x” choices.
if i==nil then i=0 end i=i+1 if i==x+1
then i=1 endDelayBuffer:Insert(function(l_1_0)if i==1 then game.game:ChangePlayerModel(“Name_model”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i==2 then game.game:ChangePlayerModel(“Name_model”)end end,{l_1_0},250,1,false)
DelayBuffer:Insert(function(l_1_0)if i=
…….
don’t write x+1
but if you have 5 model, write 6.
Thank you eXistenZ34.
You are more experienced than me.
I’m just learning.
Thank both of you guys. Especially Existenz for this small tutorial
” data-emoticon=”” srcset=”/wp-content/uploads/invision_emoticons/wink@2x.png 2x” width=”20″ height=”20″>
- You must be logged in to reply to this topic.
