TKFP

Untitled

May 19th, 2025
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local tool = script.Parent
  2. local player = game.Players.LocalPlayer
  3. local mouse = player:GetMouse()
  4. local runService = game:GetService("RunService")
  5.  
  6. local aimConnection
  7.  
  8. tool.Equipped:Connect(function()
  9. -- Aktifkan sistem aiming
  10. aimConnection = runService.RenderStepped:Connect(function()
  11. if tool:FindFirstChild("Handle") and mouse then
  12. local char = player.Character
  13. if char and char:FindFirstChild("HumanoidRootPart") then
  14. local handle = tool.Handle
  15. local direction = (mouse.Hit.Position - handle.Position).Unit
  16. handle.CFrame = CFrame.new(handle.Position, handle.Position + direction)
  17. end
  18. end
  19. end)
  20. end)
  21.  
  22. tool.Unequipped:Connect(function()
  23. -- Matikan sistem aiming saat dilepas
  24. if aimConnection then
  25. aimConnection:Disconnect()
  26. aimConnection = nil
  27. end
  28. end)
Advertisement
Add Comment
Please, Sign In to add comment