Advertisement
HowToRoblox

LightAttackClient

Apr 10th, 2022
2,298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local uis = game:GetService("UserInputService")
  2.  
  3. local mouse = game.Players.LocalPlayer:GetMouse()
  4.  
  5. local camera = workspace.CurrentCamera
  6.  
  7.  
  8. uis.InputBegan:Connect(function(inp, p)
  9.     if p then return end
  10.    
  11.     if inp.KeyCode == Enum.KeyCode.Q then
  12.        
  13.         game.ReplicatedStorage.LightAttackRE:FireServer(mouse.Hit)
  14.     end
  15. end)
  16.  
  17.  
  18. game.ReplicatedStorage.LightAttackRE.OnClientEvent:Connect(function()
  19.    
  20.     local x = math.random(-100, 100) / 1000
  21.     local y = math.random(-100, 100) / 1000
  22.     local z = math.random(-100, 100) / 1000
  23.  
  24.     script.Parent.Humanoid.CameraOffset = Vector3.new(x, y, z)
  25.     camera.CFrame *= CFrame.Angles(x / 100, y / 100, z / 100)
  26.    
  27.     wait(1)
  28.    
  29.     script.Parent.Humanoid.CameraOffset = Vector3.new()
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement