How to fling player

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Explosion Force effect

  2. What is the issue? Builtin Explosion dont work, :ApplyImpuse dont work Set the assemblyLinearVelocity kind of work, but only when your in air, SetStateEnabled Does not work, :ChageState Does not work .PlatformStand does make the player platformstand but the explosion force from my custom script does not work

for _,v in pairs(game.Players:GetChildren()) do
	if v.Character ~= nil then
		hum = v.Character.Humanoid
		local vector = (v.Character.PrimaryPart.Position - script.Parent.Position)
		local dis,dir =  (v.Character.PrimaryPart.Position - script.Parent.Position).Magnitude ,  (v.Character.PrimaryPart.Position - script.Parent.Position).Unit
		hum:TakeDamage(math.max(0.75 * (150 - dis),0))

	hum.PlatformStand = true
		hum.Parent.HumanoidRootPart.AssemblyLinearVelocity = (dir * math.max(0.75 * (150 - dis),0)*100)
	--	print(1 * (200 - dis))
	end
end
2 Likes

All you have to do to fling a character, is change the velocity of it’s HumanoidRootPart.

Example:

Character.HumanoidRootPart.Velocity = Vector3.new(math.random(-1000,1000), 1000,math.random(-1000,1000))

Hoping that helps you

3 Likes

That does not work, It doesn’t even do anything to the player

3 Likes

Its most like something to do which the character mass, you can use a for loop and set the Massless property to true.

2 Likes

If you set the player’s character’s Sit property to true before applying the impulse, it should work.

4 Likes
character.PrimaryPart.Velocity = Vector3.new(1000,1000,1000)
4 Likes

sorry for late reply but to fling player,
you can use ApplyImpulse() / AssemblyLinearVelocity
you’ll need to do it on the client otherwise it wont work

to fling players to/away from origin point

  • first you’ll need to get the direction
  • then how much force you want to fling the player with
--direction from two parts
(part2.Position - part1.Position).Unit

server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local flingCharacter = ReplicatedStorage.FlingCharacter

local flingForce = 100
local character = player.Character

flingCharacter:FireClient(player, (character.HumanoidRootPart.Position - part.Position).Unit * flingForce)

client - put this in starter character scripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local flingCharacter = ReplicatedStorage.FlingCharacter

local rootpart = script.Parent:WaitForChild("HumanoidRootPart")

flingCharacter.OnClientEvent:Connect(function(velocity)
	rootpart:ApplyImpulse(velocity) --either method works
    rootpart.AssemblyLinearVelocity = velocity --its your choice
end)
4 Likes