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

I gave the script names not to damage but it still damages them how do i fix?

Asked by 3 years ago

I'm trying to make it like a party system where certain players don't get damaged but it doesn't work. IDK why ve been trying different things for 45 mins or so and I'm lost.

script.Parent.Touched:Connect(function(hit)
    print("TOUCHED")

    local nokill = {"hellericc","TestSub"}


    for i,v in pairs(nokill) do
        local x = Instance.new("StringValue",game.Workspace.Xhels)
        x.Name = v
        print(nokill)

        if hit.Parent == v.Name then
        print(hit.Parent)
        else
            wait(1)
        print("Killing")
        hit:Destroy()
        end



    end



end)
0
Are you sure you didn't misspell your name in the nokill table, because other than it should be working. Rayguyban2 89 — 3y
0
no i did not misspell anything i'm using a different account to make the script helleric -3 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Hi! In the loop you put v.Name where the string value v does not have the property name, change v.Name to v and it should work fine.

0
or v.Name to x.Name MelodicSea5914 50 — 3y
0
tried both but they don't work i don't know what im doing wrong helleric -3 — 3y
Ad

Answer this question