Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this working?

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

✓ Accepted answer

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

4 comments

0

It works :D

0

press accept this answer

0

For some reason people are putting down my rep for no reason.

0

lol I see you waffle (;

This discussion is preserved as it was. New answers, comments, and votes are closed.