|
| 04 Nov 2016 08:38 PM |
So I have this script that allows someone on the admin list to open doors. The script uses CFrames to create animations for these doors. I plan to use this script of mine on a MASSIVELY large scale. I do not want to have to go through each part of the map, to each door's script and put in a name. I want it to automatically add someone to the admin list, if they are in my group. I know this function exists, but I'm just barely coming back to scripting and I cannot figure out how to do it. If you could, Please add to the script what I just mentioned, then link and/or comment the modified script below. Thanks!
Here is the script:
Admins = {"james2012bond"}
door1 = game.Workspace.TrainingDoors.Door1 door2 = game.Workspace.TrainingDoors.Door2 opened = false
function onChatted(msg)
if string.find(string.lower(msg), string.lower("open")) and string.find(string.lower(msg), string.lower("blue")) then
if not opened then
opened = true
for i = 1, 29 do wait(.025) door1.CFrame = CFrame.new(door1.CFrame * Vector3.new(.4,0,0)) door2.CFrame = CFrame.new(door2.CFrame * Vector3.new(-.4,0,0)) end end end
if string.find(string.lower(msg), string.lower("close")) and string.find(string.lower(msg), string.lower("blue")) then
if opened then
for i = 1, 29 do wait(.025) door1.CFrame = CFrame.new(door1.CFrame * Vector3.new(-.4,0,0)) door2.CFrame = CFrame.new(door2.CFrame * Vector3.new(.4,0,0)) end
opened = false
end end end
game.Players.PlayerAdded:connect(function (guy) for i,v in pairs(Admins) do if string.lower(guy.Name) == string.lower(v) then guy.Chatted:connect(onChatted) end end end)
Mr Bond |
|
|
| Report Abuse |
|
|
triode
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 5844 |
|
|
| 04 Nov 2016 08:44 PM |
The fact that the solution is in this script means that you didn't make this.
|
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 08:47 PM |
@tri
I did make this, a long time ago. I left, and have come back, to this game. I'm getting BACK into scripting. I wanted to improve this script. I just cant remember how. So if you could please stop being negative. That would be great. :)
Mr Bond |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 08:57 PM |
http://wiki.roblox.com/index.php?title=API:Class/ModuleScript
|
|
|
| Report Abuse |
|
|
triode
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 5844 |
|
|
| 04 Nov 2016 08:59 PM |
I'm not being negative, you are hurting yourself by reading what I am saying wrong:
look in your code and see how you would make it work with all the doors. Although I may add, if you have double doors you will run into a problem. Literally, look in your code and you will find a solution.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 05 Nov 2016 09:16 PM |
| http://wiki.roblox.com/index.php?title=API:Class/Player/IsInGroup |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2016 08:58 AM |
Thanks man, that helps alot!
Mr Bond |
|
|
| Report Abuse |
|
|