I am trying to add a creator tag to my gun tool but every time I use it against an enemy NPC, it doesn't work. My problem in the Output bar keeps showing this:

Players.Simpletton.Backpack.Italian Gun.Scripts.BackendScript:131: attempt to index upvalue 'hit' (a function value)

if anyone can help here's the creator tag script My creator tag script:

if hit.Parent.Humanoid.Health <= 0 then 
local creator = Instance.new("BoolValue", hit.Parent.Humanoid)
creator.Name = "creator"

5 comments

0

Please provide the full code. The only issue I see is you're doing something like local function hit(...) ... end and then you're trying to index that function.

0

edit your question.. dont put it in a comment lmao. v edit button right there

0

uhh you mean add the entire gun script?

0

;-;