Hi..(Thanks for any help in advance) I am making a command script for my group and i already have most of the commands done but this one isnt working. when i say open this model with 4 parts becomes Visible. I already tried it with a part and it worked but i transferred the script to the model and now its not working. Output shows nothing but I think whats messing up something is when I call the model. I dont think its the chatted part or the admin part because it worked when it was a part and like ive said ive already made other commands. Here it is...
local Admins = {"iSvenDerp"}
P = script.Parent:GetChildren("Part","Part","Part","Part")
function checkAuthority(name)
for a,v in pairs(Admins) do
if v == name then
return true
end
end
return false
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "open" or msg == "Open" and checkAuthority(player.Name) then
P.CanCollide = true
P.Transparency = 0
end
end)
end)
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == "close" or msg == "Close" and checkAuthority(player.Name) then
P.CanCollide = false
P.Transparency = 1
end
end)
end)

2 comments
Why on line 2 do you define the 4 "Part"? :GetChildren() doesnt require anything but a location to get the children from.
I get what your saying but i also had a script in there so i could till do it and it wouldnt hurt anything right?