Advertisement
HowToRoblox

SheriffClient

Nov 18th, 2022 (edited)
1,933
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local tool = script.Parent
  2.  
  3. local cam = workspace.CurrentCamera
  4. local mouse = game.Players.LocalPlayer:GetMouse()
  5.  
  6. local rs = game.ReplicatedStorage:WaitForChild("MurderMysteryReplicatedStorage")
  7. local config = require(rs:WaitForChild("CONFIGURATION"))
  8. local re = rs:WaitForChild("RemoteEvent")
  9.  
  10. local onCooldown = false
  11.  
  12.  
  13. tool.Activated:Connect(function()
  14.     mouse.TargetFilter = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
  15.    
  16.     if not onCooldown then
  17.         onCooldown = true
  18.  
  19.         re:FireServer("SHERIFF SHOOT", tool, cam.CFrame, mouse.Hit)
  20.        
  21.         task.wait(config.SheriffWeaponCooldown)
  22.         onCooldown = false
  23.     end
  24. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement