Advertisement
meatball222

Roblox FPS arms Script

Oct 7th, 2020
5,104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2.  
  3. local char = player.Character
  4.  
  5. local cam = workspace.Camera
  6.  
  7. local run = game:GetService("RunService")
  8.  
  9. local arms = game.ReplicatedFirst.FPSARMS:Clone()
  10.  
  11. local MyGun = script.Parent
  12.  
  13. local GunHandle = MyGun:WaitForChild("Handle")
  14.  
  15. arms.Parent = cam
  16.  
  17.  
  18. MyGun.Equipped:Connect(function()
  19.  
  20. local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
  21. FPSARMS.LeftArm.Transparency = 0
  22. FPSARMS.RightArm.Transparency = 0
  23.  
  24. GunHandle.Transparency = 1
  25.  
  26. local Humanoid = arms.Humanoid
  27. local Animation = arms.Animation
  28. local LoadAni = Humanoid:LoadAnimation(Animation)
  29. LoadAni:Play()
  30.  
  31. local GunModel = FPSARMS.GunModel:GetChildren()
  32.  
  33. for i, value2 in pairs(GunModel) do
  34.  
  35. value2.Transparency = 0
  36.  
  37.  
  38. end
  39.  
  40.  
  41. end)
  42.  
  43. if MyGun.Equipped then
  44.  
  45. arms.Parent = cam
  46.  
  47. run.RenderStepped:Connect(function()
  48.  
  49. arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,-2,-2.5) * CFrame.Angles(0,0,0))
  50.  
  51. end)
  52. end
  53.  
  54.  
  55.  
  56. MyGun.Unequipped:Connect(function()
  57.  
  58. arms.Parent = cam
  59.  
  60. local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
  61. FPSARMS.LeftArm.Transparency = 1
  62. FPSARMS.RightArm.Transparency = 1
  63.  
  64. local GunModel = FPSARMS.GunModel:GetChildren()
  65.  
  66. for i, value in pairs(GunModel) do
  67.  
  68. value.Transparency = 1
  69.  
  70.  
  71. end
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. end)
  79.  
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement