ShoccessX

Untitled

Sep 8th, 2024
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. -- Services
  2. local Players = game:GetService("Players")
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4.  
  5. -- Player Variables
  6. local localPlayer = Players.LocalPlayer
  7. local backpack = localPlayer:WaitForChild("Backpack")
  8. local actionValues = backpack:WaitForChild("ActionValues")
  9. local power = actionValues:WaitForChild("Power")
  10.  
  11. -- Globals
  12. _G.Xp = false
  13. _G.Multiplier = 50 -- Set the shot multiplier to 50
  14. _G.ChangeValue = 1
  15.  
  16. -- Function to Fire Shots Based on Multiplier
  17. local function onPowerChanged()
  18. if power.Value >= _G.ChangeValue and _G.Xp then
  19. local args = {
  20. [1] = false,
  21. [2] = "Shooting",
  22. [3] = "Standing Shot"
  23. }
  24.  
  25. local playerEvents = backpack:FindFirstChild("PlayerEvents") or ReplicatedStorage:FindFirstChild("PlayerEvents")
  26.  
  27. if playerEvents then
  28. local shootingEvent = playerEvents:FindFirstChild("Shooting")
  29. if shootingEvent then
  30. for i = 1, _G.Multiplier do
  31. shootingEvent:FireServer(unpack(args))
  32. end
  33. else
  34. warn("Shooting event not found in PlayerEvents.")
  35. end
  36. else
  37. warn("PlayerEvents folder not found in either Backpack or ReplicatedStorage.")
  38. end
  39. end
  40. end
  41.  
  42. -- Connect Power Change Signal
  43. power:GetPropertyChangedSignal("Value"):Connect(onPowerChanged)
  44.  
  45. -- Example Usage: Setting values
  46. _G.Xp = true -- Set to true to enable shooting
  47. _G.ChangeValue = 50 -- Minimum power value to trigger the shot
Advertisement
Add Comment
Please, Sign In to add comment