Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i stun a player?

Theres a game that ive been playing and ive wondered how one of the weapons work. If you were to hit someone with this bat they would go flying. What would you use to fling the player away?

(not a request, just a general question)

4 comments

0

You would insert a body mover into the HumaniodRootPart of a player when they are touched with a part in the tool

1

game.Players.LocalPlayer:Kick('ur stunned because u just left the game')

0

lmao thanks ^

0

Body velocity and Humanoid.PlatformStand = true

1 answer

✓ Accepted answer

first you will need to make the player not be able to move here

player.Character.Humanoid.JumpPower = 0
player.Character.Humanoid.WalkSpeed = 0

this will not allow the player to move

Now you will need to add a body velocity to the players HumanoidRootPart Like this!

local BodyVelocity = Instance.new("BodyVelocity",player.Character.HumanoidRootPart)

after those things you will need to make the player fly back using LookVector with CFrame like this :

BodyVelocity.Velocity = script.Parent.CFrame.LookVector * -100
wait(1)
BodyVelocity:Destroy()

Hope I Helped!

2 comments

0

Note This will all have to be added to the weapon and you will have to use Remote Events on it too!

0

il attempt to use that soon, and plus i forgot about this question, but thank you for taking the time to answer it, appreciate it dude

This discussion is preserved as it was. New answers, comments, and votes are closed.