|
| 02 Jan 2015 04:19 AM |
This is for my holo, so it's a script that opens and closes the map to prevent cheaters going out of the map then entering on the enemies side. Whenever I say :openmap, the parts CanCollide turn false, that bit works, but when I say :closemap the parts CanCollide will remain false.
NOTE: FOLLOW ME IF YOU DONT UNDERSTAND!
admins = {"Dementiz","TheRobloxian909","Irciletalking","SirAnthonyDeSmet"} --Admin names here
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then return true end end return false end
local door=script.Parent game.Players.PlayerAdded:connect(function(p) if isAdmin(p.Name) then p.Chatted:connect(function(msg) if msg:lower() == string.lower(":openmap") then --this can be changed for i,v in pairs(door:GetChildren()) do v.CanCollide=false end elseif msg:lower() == string.lower(":closemap") then --can also be changed for i,v in pairs(door:GetChildren()) do v.CanCollide=true end end end) end end) |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2015 04:35 AM |
Actually if you dont understand, party me then I'll tell you when, I'm on afk for 10 mins
|
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jan 2015 08:23 AM |
Hope this works:
admins = {"Dementiz","TheRobloxian909","Irciletalking","SirAnthonyDeSmet"} --Admin names here
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then return true end end return false end
local door=script.Parent game.Players.PlayerAdded:connect(function(p) if isAdmin(p.Name) then p.Chatted:connect(function(msg) if msg:lower() == string.lower(":openmap") then --this can be changed for i,v in pairs(door:GetChildren()) do v.CanCollide=false elseif msg:lower() == string.lower(":closemap") then --can also be changed for i,v in pairs(door:GetChildren()) do v.CanCollide=true end end end end) end end) |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2015 08:27 AM |
| Probably because not everything inside the door is a part... |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2015 08:29 AM |
If in that case, then:
local door=script.Parent game.Players.PlayerAdded:connect(function(p) if isAdmin(p.Name) then p.Chatted:connect(function(msg) if msg:lower() == string.lower(":openmap") then --this can be changed for i,v in pairs(door:GetChildren()) do if v:IsA("BasePart") then v.CanCollide=false end elseif msg:lower() == string.lower(":closemap") then --can also be changed for i,v in pairs(door:GetChildren()) do if v:IsA("BasePart") then v.CanCollide=true end end end end) end end)
Not sure if it will work but hopefully. |
|
|
| Report Abuse |
|
|