#Why isn't knockback being applied?

1 messages · Page 1 of 1 (latest)

versed cipher
#

pChar and eChar are being applied to the right objects, but the extra velocity just isnt being added to eChar

rf.OnServerInvoke = function(pChar, eChar)
    print(pChar)
    print(eChar)
    if pChar and eChar then
        local pHRP = pChar:FindFirstChild("HumanoidRootPart")
        local eHRP = eChar:FindFirstChild("HumanoidRootPart")

        if pHRP and eHRP then

            local dir = (eHRP.Position - pHRP.Position).Unit

            local att = Instance.new("Attachment", eHRP)

            local force = Instance.new("VectorForce", eHRP)

            force.Attachment0 = att
            force.Force = dir.Unit * 10000
            force.RelativeTo = Enum.ActuatorRelativeTo.World

            eHRP.Humanoid.PlateformStand = true --ragdoll yes or no

        end
    end
end
safe nexus
versed cipher
versed cipher
safe nexus
#

maybe try ragdolling first and then parenting the force to ehrp?

magic hedge
#

the server would receive as first argument the player that is invoking it

versed cipher
#

huh

safe nexus
#

rf.OnServerInvoke = function(pChar, eChar)

#

here

#

the first argument

#

should be plr

#

so it would look like this

#
rf.OnServerInvoke = function(player:Player,pChar, eChar)
#

someone have already said this in a previous post

versed cipher
#

that didnt really change anything, this is how im calling the function

magic hedge
#

you're not even firing two things

safe nexus
#

whats this v.Parent? player? character?

magic hedge
#

first of all now eChar is nil

magic hedge
#

so this if statement just does not run

versed cipher
versed cipher
safe nexus
versed cipher
#

so a player

safe nexus
#

alright, so the pChar is the Player and the eChar is the character. When you do local pHRP = pChar:FindFirstChild("HumanoidRootPart") it will be nil because pChar is a player, not Character

urban cedarBOT
#

studio** You are now Level 4! **studio

safe nexus
#

do you get it or nah

versed cipher
#

not really i dont get why it would be nil

safe nexus
#

if you want a character, you need to write pChar.Character

versed cipher
#

okay

safe nexus
#

the character is like the model in the world

versed cipher
#

oh

#

shoot

safe nexus
#

and player is a client

versed cipher
#

it works now

safe nexus
#

yesss

#

great

versed cipher
safe nexus
#

the player is always in game.Players

#

hope that makes sense

versed cipher
#

OHH yeah yeah okay

#

ty