#Why does my code stop executing at this line?

1 messages · Page 1 of 1 (latest)

dusty tinsel
#

Line where code stops executing:
Line 35

-- v.Parent is a Player
local isParrying = getStateEvent:Fire(plr, v.Parent, "Parrying")

Function it's calling:

local getStateEvent = game.ReplicatedStorage:WaitForChild("GetStateEvent")

getStateEvent.Event:Connect(function(plr, enemy, stateKey)

    local stateKey = enemy:GetAttribute(stateKey)

    if stateKey == nil then
        stateKey = false
    end

    return stateKey
end)

Script locations:

wet rose
#

Which line is 35?

proud ermine
upper obsidianBOT
#

studio** You are now Level 9! **studio

upper obsidianBOT
#

studio** You are now Level 8! **studio

dusty tinsel
wet rose
#

Of the first or second script

dusty tinsel
#

first

wet rose
#

Wait is this a binded event?

#

Or remote

dusty tinsel
#

BindableEvent

wet rose
#

Ah that’s why they are very different from remote events

#

You can’t connect them

dusty tinsel
#

why not?

wet rose
#

The event has to equal a function

dusty tinsel
#

hm okay

wet rose
#

They are mad annoying I would search up an example

queen goblet
dusty tinsel
dusty tinsel
queen goblet
dusty tinsel
#

oh okay thats good

#

i dont understand this error

getStateFunction.OnInvoke:Connect(function(plr, enemy, stateKey) -- Line 7

    local stateKey = enemy:GetAttribute(stateKey)

    if stateKey == nil then
        stateKey = false
    end

    return stateKey
end)
#

OnInvoke is a callback member of BindableFunction; you can only set the callback value, get is not available - Server - GetAttribute:7

queen goblet
dusty tinsel
#

oh woops i forgot they're different like that