#help script

1 messages · Page 1 of 1 (latest)

versed sand
#

hi there is a problem in my script. Im trying to implement a knockback system true a model script, but it just doesn't work

this is the error:

14:59:13.766 ReplicatedStorage.Modules.OwnModule:139: attempt to call a table value - Client - OwnModule:139

#

this is the part with the problem

#

local ragdoll = require(game:GetService("ReplicatedStorage").Modules.Ragdoll)
local knockback = require(game.ReplicatedStorage.Modules.KnockBack)

            local db = {}
            -- Voeg .Touched toe aan elke GroundSlam-part
            part.Touched:Connect(function(hit)
                if table.find(db, hit.Parent) then return end
                local hum = hit.Parent:FindFirstChild("Humanoid")
                if hum then
                    table.insert(db, hit.Parent)
                    print("Type knockback:", typeof(knockback))
                    knockback.Start(hit.Parent, (hit.Parent.HumanoidRootPart.Position - part.Position).Unit * Vector3(60, 0 , 60) + Vector3(0, 40))
                    ragdoll.Start(hit.Parent)
                    task.wait(5)
                    table.remove(db, table.find(db, hit.Parent))
                    ragdoll.Stop(hit.Parent)
                end
            end)
#

btw it prints this: print("Type knockback:", typeof(knockback))

#

but for some reason the error starts on this line:

knockback.Start(hit.Parent, (hit.Parent.HumanoidRootPart.Position - part.Position).Unit * Vector3(60, 0 , 60) + Vector3(0, 40))

stuck elbow
#

Vector3.new, not Vector3()

#

Also, the second vector3 only has 2 values in it. Yet it requires 3 numbers... as made clear by the 3 in it's classname

versed sand
#

YOOOOO WHAT

#

eeh thank you mate

#

i've been reading over it so many times

#

THANK YOU