Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't my Tagging not working? [UNANSWERED D:<]

Asked by 9 years ago

I made a script that basically releases a ball full of light. And every time a Player successfully kills another player, they receive 15 PTS. But I made it by using a ROBLOX method, and it's not working. Take a look.

function Kill(Part)
    if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= "script.Parent.Name" then
        script.Disabled = true
        f = Instance.new("Fire")
        for i =1,25 do
    Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -3
    wait(0.05)
        end
        script.Parent:Remove()
    end
    wait(0.025)
end
script.Parent.Touched:connect(Kill)
function CreateTags(Attacker, victimHumanoid)
    for i, v in pairs(victimHumanoid:GetChildren()) do
        if v.Name == "creator" then
            v.Remove()

        end
    end
    Tag = Instance.new("ObjectValue")
    Tag.Parent = victimHumanoid
    Tag.Name = "creator"
    Tag.Value = Attacker

local searchup = Attacker:FindFirstChild("Data")
if searchup then
    local searchup2 = Attacker.Data:FindFirstChild("Haoshoku")
    if searchup2 then
        Attacker.Data.Haoshoku.Value = Attacker.Data.Haoshoku.Value + 15
    end
    end
end
CreateTags()

Everything until the 2nd Function works.

2 answers

Log in to vote
0
Answered by 9 years ago

script.Parent.Name is a string at line 2

0
That isn't the problem. It works perfectly as a string. offbeatpizzalives123 105 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
--Fix line 2 of code
 if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= script.Parent.Name then
0
That isn't the problem. It works perfectly as a string. The problem is the 'CreateTags(Attacker, VictimHumanoid)' offbeatpizzalives123 105 — 9y

Answer this question