Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local player = game:GetService("Players").LocalPlayer
- tool.Equipped:connect(function(mouse)
- print("Tool equipped!")
- mouse.Button1Down:connect(function()
- print("Mouse pressed!")
- local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * 300)
- local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
- local ball = game.Players.LocalPlayer.Backpack.Balls.SpikeBall:Clone(workspace)
- local distance = (tool.Handle.CFrame.p - position).magnitude
- ball.CFrame = CFrame.new(tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
- game:GetService("Debris"):AddItem(ball, 0.1)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement