Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How should i do to fling a person efficiently for my game? [closed]

Asked by 4 years ago

Title says it all, How do i fling a person?, tried multiple scripts but they dont really work out for me. I need know how to make one that works good and has a good vibe for my game i am making.

Thx

0
body forces, you can look them up on the roblox developer wiki DeceptiveCaster 3761 — 4y
0
What Code are you using? aj44000 2 — 4y

Closed as Not Constructive by JakyeRU and hiimgoodpack

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer

local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait()
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local Humanoid = Character:FindFirstChildOfClass("Humanoid")

repeat RunService.Stepped:wait() until Character and HumanoidRootPart -- once player loaded

wait(5) -- waits 5

local X, Y, Z = math.random(1, 500), math.random(1, 1000), math.random(1, 500) -- our fling coordinates

Humanoid:ChangeState(Enum.HumanoidStateType.FallingDown) -- this will make it so the player is stunned.
HumanoidRootPart.Velocity = Vector3.new(-X, Y, -Z) -- we change the velocity here.

Hope this has helped as for my knowledge there's many 'efficient' ways you could go about doing something such as this but this is a reliable and 'efficient' method, also keep note that this is a client script.

Have a great day.

Ad