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

Trying to make a admins to be able to go through parts using CanCollide, but it does nothing?

Asked by 5 years ago
Edited by User#24403 5 years ago

bindable funtion is called Getlist, admin script is called admin and part script is called script

admins = ("Kaleb_PIayz, Bluoed")

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

and this is the part bit of it:

part = script.Parent

part.Touched:Connect(function(hit)

local humanoid = hit.Parent:FindFirstChild("humanoid")

if humanoid then

local playerName = hit.Parent.Name

local check = game.Workspace.admin.Getlist:Invoke(playerName)

if check == true then

part.CanCollide = false

end

end

end)

it does nothing and idk why. its supposed to let those people through, but it does nothing, even to people who arent on that list.

1
The table constructor in Lua is {...} not (...) User#24403 69 — 5y
1
^ yes. Also, why do people always post scripts like this? It's so hard to read... Also, use the UserId, not the player's name, as the UserId will never change. I don't know what your issue is, but why not use a LocalScript so ONLY the admins go through? RiskoZoSlovenska 378 — 5y

Answer this question