How to fling players

Hey,
I’m working on an Admin panel for my game.
I’ve been searching on the dev forum for quite a while on how to fling a player but I haven’t got a solution.
I searched on google and all I found is exploit scripts.
Does anyone know how to fling a player? (R15)

Regards : )

21 Likes

Use apply inpulse on a part like the HumanoidRootPart.

3 Likes

HumanoidRootPart:ApplyImpulse(…) doesn’t work.

2 Likes

Try this before the fling system :

local Part = script.Parent
local End = workspace.End

wait(2)

while true do
	local direction = End.Position - Part.Position
	local force = direction + Vector3.new(0, workspace.Gravity * 0.5, 0)
	
	Part:ApplyImpulse(force * Part.AssemblyMass)
	wait(2)
end
5 Likes

Nothing happens + no output.

I’m trying to fling a player, therefore, I used HumanoidRootPart instead of “Part”:

function script.Parent.OnServerInvoke(player, Target, speaker)
	
	local speaker = speaker
	print(speaker)
	local plr = Target
	local character = game.Workspace:FindFirstChild(Target)
	local plrHumanoid = character.Humanoid
	local plrRP = character.HumanoidRootPart
	local End = workspace.End
	
	while true do
		local direction = End.Position - plrRP.Position
		local force = direction + Vector3.new(0, workspace.Gravity * 0.5, 0)
		
		plrRP:ApplyImpulse(force * plrRP.AssemblyMass)
		wait(2)
	end
	
end

But sadly it still does not work.

3 Likes

Set the humanoid’s state to Platform stand, and then set their velocity extremely high in any up direction.

char.Humanoid.PlatformStand = true
char.PrimaryPart.AssemblyLinearVelcoity = Vector3.new(0,10000,10000)

Maybe some rotation too, to make it look more fun :slight_smile: also if you apply enough rotation, the character will automatically enter platform stand

local RNG = Random.new()
Character.HumanoidRootPart.AssemblyLinearVelocity = RNG:NextUnitVector() * 5000
Character.HumanoidRootPart.AssemblyAngularVelocity = RNG:NextUnitVector() * 2500
2 Likes

Happens the same thing, doesn’t work + no output shown.

This is what I have so far:

function script.Parent.OnServerInvoke(player, Target, speaker)
	
	local plr = Target
	local character = game.Workspace:FindFirstChild(Target)
	local plrHumanoid = character.Humanoid
	local plrRP = character.HumanoidRootPart
	
	
	local RNG = Random.new()

	plrRP.AssemblyLinearVelocity = RNG:NextUnitVector() * 5000
	plrRP.AssemblyAngularVelocity = RNG:NextUnitVector() * 5000
	
end

Should I change/add anything?

It looks like the script is a child of a RemoteFunction. Where is this RemoteFunction located? Have you checked if the script runs at all?

Script is located at StarterGUI.AdminPanel.Events.FlingFunction (it’s a Remote Function)

The script does run.

Wait I found the problem. The server doesn’t have network ownership over the Character, and it is essentially “glued” to the ground(not sure how to explain it really). Try running it like this:`

local RNG = Random.new()

plrRP:PivotTo(plrRP:GetPivot() + Vector3.yAxis)
plrRP.AssemblyLinearVelocity = RNG:NextUnitVector() * 5000
plrRP.AssemblyAngularVelocity = RNG:NextUnitVector() * 5000
3 Likes

You’re an absolute genius, thank you.

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