So I am learning about scripting, and a created a bindable function script that doesn't seem to work properly. I created a list of players who could touch a brick to make its collision false, but the list doesn't work, it just kills me instead. Here are the two scripts:
part = script.Parent
part.Touched:connect(function(hit)
humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
plrName = hit.Parent.Name
ifadm = game.Workspace.AdmList.List:Invoke(plrName)
if ifadmin == true then
part.CanCollide = false
else
humanoid.Health = 0
end
end
end)
--1st script(inside brick)
adms = {"YouCheater"}
script.List.OnInvoke = function(name)
isadm = false
for i, v in pairs(adms) do
if name == v then
isadm = true
break
end
if isadm == true then
return true
else
return false
end
end
end
--2nd Script(with the bindable function)
