Ok so I have Filtering Enabled and I would like to keep it on and I have a tool named "Football"

Inside the Football tool, is a LocalScript and inside that LocalScript is a Script.

And inside the Script, i want it to subtract 1.75 from the velocity of the Tool's handle until it hits an object.

When i run it in studio it works perfectly, but actually in-game it doesn't work at all it just floats away.

Here Is The Script

local replicatedstorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local bodyp = script.Parent.BodyVelocity
local bodya = script.Parent.BodyAngularVelocity
local connection = nil
local power=tonumber(script.Name) or 0;

function OnTouch(hit)
	if (hit.CanCollide and hit.Anchored) then
		bodya:Remove()
		bodyp:Remove()
		connection:disconnect()
	end
end


connection = script.Parent.Touched:connect(OnTouch)

while true do
wait()
bodyp.velocity=bodyp.velocity-Vector3.new(0,1.75,0);
end

The Script and LocalScript does not use any RemoteEvents but everything else works perfectly its just this part while true do wait() bodyp.velocity=bodyp.velocity-Vector3.new(0,1.75,0); end

7 comments

0

This code is in the script or the localscript?

0

Its in the script, and hey cabbler lol

0

lol i didn't recognize you. yo. If this all in the script Idk what to tell you. Debug that loop by printing stuff every time

0

Ok

0

Want to talk on discord?

0

And nothing gets printed when the ball is thrown

0

@InnovativeDesires I really don't know. Best I can offer right now, add a print() in between every line, and see where the script stops executing. Random guess, add wait() right at the beginning, it USED to help things execute properly...