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

Why isn't this working?

Asked by 10 years ago

When I enter as bosswalrus it doesn't let me through it kills me.

local entries = {["bosswalrus"] = true, ["bealot"] = true, ["BrockHCCS"] = true}

script.Parent.Touched:connect(function(hit)
    humanoid = hit.Parent:FindFirstChild("Humanoid")
    if (humanoid ~= nil) then
        Char = humanoid.Parent
        if Char == true and entries[Char.Name] then
            script.Parent.CanCollide = false
            script.Parent.Transparency = 0.5
        else
            humanoid.Health = 0
        end
    end
end)

1 answer

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

Get rid of == true; Char is an instance so it will never be equal to a bool.

0
It works :D BosswalrusTheCoder 88 — 10y
0
press accept this answer 1waffle1 2908 — 10y
0
For some reason people are putting down my rep for no reason. BosswalrusTheCoder 88 — 10y
0
lol I see you waffle (; soaprocks2 75 — 10y
Ad

Answer this question