Hello there,
Here is the code:
local plrs = game:GetService("Players"); local plr = plrs.LocalPlayer; local uis = game:GetService("UserInputService"); local mouse = plr:GetMouse(); local debris = game:GetService("Debris"); function click(obj, gp) if obj.KeyCode == Enum.KeyCode.Q and not gp then local part = Instance.new("Part"); local char = plr.Character or plr.CharacterAdded:Wait(); local torso = char:FindFirstChild("Torso") or char:WaitForChild("UpperTorso"); part.Shape = Enum.PartType.Ball; part.Size = Vector3.new(5, 5, 5); part.CanCollide = false; part.Transparency = .5; part.BrickColor = BrickColor:random(); part.TopSurface = Enum.SurfaceType.Smooth; part.BottomSurface = Enum.SurfaceType.Smooth; part.Parent = workspace; part.Touched:Connect(function(hit) if hit.Parent.Name == "Part" and hit.Parent:IsA("Model") then hit:Destroy(); part:Destroy(); end end) local bv = Instance.new("BodyPosition"); bv.Parent = part; bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge); local pos = mouse.Hit.p; local diff = (pos - torso.Position).magnitude; if diff > 50 then pos = pos.Unit * 50; end bv.Position = pos; part.CFrame = torso.CFrame; bv.ReachedTarget:Connect(function() print("It reached."); end) debris:AddItem(part, 5); end end uis.InputBegan:Connect(click);
~~ KingLoneCat