How to use applyimpulse without network ownership ruining everything

  1. What do you want to achieve?

I want to learn how to use apply impulse properly.

  1. What is the issue?

I don’t know how I can use apply impulse on the client and server as network ownership can differ because the player owns the impulse.

Local script in StarterCharacterScripts

This is me attempting to use apply impulse on the client but I don’t know why it isn’t working:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		task.wait(3)
		character.HumanoidRootPart:ApplyImpulse(character.HumanoidRootPart.CFrame.UpVector * 10000)
	end)
end)
  1. What solutions have you tried so far?

Not much, but I’ve tried checking other posts.

2 Likes

The PlayerAdded connection is made after the player joins, thus never firing on the client.

You ahould play around with ApplyImpulse() using the command bar and implement it where it’s needed in your game. Remember that this doesn’t work on server because, as you said, network ownerships.

It’s a local script in starterplayerscripts.

Oh I see my issue I was using a player added event and character added event, but I don’t know why my script didn’t work when I had the character added event. I removed it and it worked. Used the character added in starter player scripts, and it worked.

Nevermind I know, it’s because StarterCharacterScripts only runs when the character is added. the Character Added event can’t fire since it already happened.

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