Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i have been trying to make a basketball shooting script but the ball keeps cloning and idk why?

Asked by 2 years ago
Edited by imKirda 2 years ago

Is there someway to disable the cloning part in the script without breaking it or something?

Please help.

here is the code:


local tool = script.Parent local remote = tool.Shoot local players = game:GetService("Players") local goal = workspace.goal remote.OnServerEvent:Connect(function(player) if player ~= players:GetPlayerFromCharacter(script.Parent.Parent) then return end local ball = script.Parent.Handle:Clone() ball.CFrame = script.Parent.Handle.CFrame local trajectory = 1 local g = Vector3.new(0, -game.Workspace.Gravity, 0) local x0 = ball.CFrame * Vector3.new(0,0,0) local v0 = (goal.Position - x0 - 0.5 * g * trajectory * trajectory)/trajectory ball.Velocity = v0 ball.Parent = workspace ball.CanCollide = true end)
0
You should probably delete the ball after its been cloned Just_Pointless 0 — 2y
0
remove :Clone() from line 12 lmao greatneil80 2647 — 2y

Answer this question