I’ve made chat commands and I recently added a new command: “J:Fling”. This command is supposed to fling the Target’s HRP using body forces, for a split second or so before destroying the instance, to create the fling affect. However, when I try to implement this, it doesn’t work. Any reason why?
SS Code:
elseif Command == "J:Fling" then
print("Flinging...")
local Target = ArgsTable[2]
if Target == "all" then
for indexPlayer, Player in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
local HRP = Character:WaitForChild("HumanoidRootPart")
local BodyForce = Instance.new("BodyForce")
BodyForce.Force = Vector3.new(0, 9999999, 0)
BodyForce.Parent = HRP
delay(.5, function()
BodyForce:Destroy()
end)
end
end
else
local Found_Player = MainModule.FindClosestMatchString("PlayerSearch", game.Players:GetPlayers(), Target)
if Found_Player then
local Character = Found_Player.Character
if Character then
local HRP = Character:WaitForChild("HumanoidRootPart")
local BodyForce = Instance.new("BodyForce")
BodyForce.Force = Vector3.new(0, 99999, 0)
BodyForce.Parent = HRP
delay(.5, function()
BodyForce:Destroy()
end)
end
end
end
I know the module functions work, as I use them for other commands, I’d really appreciate an explanation as to why it won’t fling. Thanks!