Fling all product is not working

simple fling all devproduct is not working can someone help

productFunctions[1747009608] = function(receipt, player)

	local Player = game.Players:GetPlayerByUserId(receipt.PlayerId)

	local RemoteEvent = ReplicatedStorage:WaitForChild("FlingEveryone")

	for _, player in ipairs(game.Players:GetPlayers()) do

		if player ~= Player then

			player.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(100, 100, 100)
			player.Character.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new(100, 100, 100)

			RemoteEvent:FireAllClients(Player.Name)

		end

	end

end

Can you show more of the code?

that is all of the code

this part is not working

player.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(100, 100, 100)
player.Character.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new(100, 100, 100)

Here is how I did my fling script, just keep in mind that BodyVelocity is deprecated.

local Velocity = Instance.new("BodyVelocity", HumanoidRootPart)
Velocity.Velocity = HumanoidRootPart.CFrame.Rotation * Vector3.new(0, 250, -250)
Velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
task.wait(0.3)
Velocity:Destroy()

Also, you should put your remote event variable outside of the receipt function.

Edit: @Katrist’s method is better, mark him as the solution

You can set the network owner first.

Code:

productFunctions[1747009608] = function(receipt, player)

	local Player = game.Players:GetPlayerByUserId(receipt.PlayerId)

	local RemoteEvent = ReplicatedStorage:WaitForChild("FlingEveryone")

	for _, player in ipairs(game.Players:GetPlayers()) do

		if player ~= Player then
			player.Character.HumanoidRootPart:SetNetworkOwner(nil)

			player.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(100, 100, 100)
			player.Character.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new(100, 100, 100)
			player.Character.HumanoidRootPart:SetNetworkOwner(player)

			RemoteEvent:FireAllClients(Player.Name)

		end

	end
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.