Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local runService = game:GetService("RunService")
- local aimConnection
- tool.Equipped:Connect(function()
- -- Aktifkan sistem aiming
- aimConnection = runService.RenderStepped:Connect(function()
- if tool:FindFirstChild("Handle") and mouse then
- local char = player.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- local handle = tool.Handle
- local direction = (mouse.Hit.Position - handle.Position).Unit
- handle.CFrame = CFrame.new(handle.Position, handle.Position + direction)
- end
- end
- end)
- end)
- tool.Unequipped:Connect(function()
- -- Matikan sistem aiming saat dilepas
- if aimConnection then
- aimConnection:Disconnect()
- aimConnection = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment