I've put this code in a script named "ListofAdmins" with a bindable function named "GetList" admins = {"Player1", "TimHarrison"}

script.GetList.OnInvoke = function(name) local isAdmin = false for i, v in pairs (admins) do if name ==v then isAdmin = true break end end if isAdmin == true then return true else return false end end I've put this script in a part that I want to change the color of when I step on it part = script.Parent

part.Touched:connect(function(hit) local humaniod = hit.Parent:FindFirstChild("Humaniod") if humaniod then local playerName = hit.Parent.Name local check = game.Workspace.ListofAdmins.GetList:Invoke(playerName) if check == true then part.BrickColor = BrickColor.new("Bright red") else humaniod.Health = 0 end end

end) Could someone explain to me why this is not working? It isn't killing me or changing color.

2 comments

0

Hey Tim! I'd recommend making sure to use the tools provided by the site to ensure that you make your code as readable as possible, so that people have an easier time answer your questions :) As far as your problem is concerned, one error that I've spotted off the bat is that you're attempting to find a humanoid by the name of 'Humaniod', though I'm not sure if that's a typo, or if you renamed you

0

-continued- or if you renamed your Humanoids. Sorry about that, hit the character limit on accident :P