GGametypePlayer

SnailChat Client

Oct 30th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. local CanShoot = nil
  2. local DamagePlayerInShoot = nil
  3. local CanStart = nil
  4. local Reload = false
  5.  
  6.  
  7. local Ammo = script.Parent:WaitForChild("Ammo")
  8. local MaxAmmo = script.Parent:WaitForChild("MaxAmmo")
  9.  
  10. local FirePart = script.Parent.Parent.FirePart
  11.  
  12. local Damage = script.Parent.Damage
  13. local ShootEvent = script.Parent.Shoot
  14.  
  15. local Character = game.Players.LocalPlayer.Character
  16.  
  17. print("Client Loaded")
  18.  
  19. function ReloadFunc()
  20. Reload = true
  21. wait(1)
  22. MaxAmmo = script.Parent.MaxAmmo
  23. Reload = false
  24. end
  25.  
  26. function Shoot()
  27. CanStart = true
  28. DamagePlayerInShoot = true
  29. if CanStart then
  30. wait()
  31. Ammo = script.Parent.Ammo.Value * -1
  32. end
  33. if CanStart and DamagePlayerInShoot then
  34. ShootEvent:FireServer()
  35. wait()
  36. Damage:FireServer(10,Character.Humanoid)
  37. end
  38. end
  39.  
  40. script.Parent.Parent.Equipped:Connect(function(Mouse)
  41. script.Parent.Parent.Activated:Connect(function()
  42. Mouse.Button1Down:Connect(function()
  43. Shoot()
  44. end)
  45. end)
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment