Aimcac

Skate script

Sep 12th, 2015
6,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function skate()
  2.     for k, v in ipairs (getElementsByType("player")) do
  3.         local skin = getElementModel(v)
  4.         if (skin == 92) or (skin == 99) then
  5.             setPedWalkingStyle(v,138)  
  6.         end
  7.     end
  8. end
  9. addEventHandler("onResourceStart",root,skate)
  10.  
  11. function skate2(_, newModel)
  12.     if (newModel == 99) or (newModel == 92) then
  13.         setPedWalkingStyle(source,138)
  14.         --outputChatBox("test")
  15.     end
  16. end
  17. addEventHandler("onElementModelChange",root,skate2)
  18.  
  19. addCommandHandler("skate",
  20.     function(playerSource)
  21.         local rannum = math.random(1, 2)
  22.         if rannum == 1 then
  23.             setElementModel(playerSource, 92)
  24.             setPedWalkingStyle(playerSource,138)
  25.         elseif rannum == 2 then
  26.             setElementModel(playerSource, 99)
  27.             setPedWalkingStyle(playerSource,138)
  28.         end
  29.     end
  30. )
Advertisement
Add Comment
Please, Sign In to add comment