Command based issues?
Basically, I'm making a command based hologram by myself..And I've got the inserting map command working, but there was an issue. The issue is when I use the command, it loads the maps and the two teams. But once I use a admin command script to change my team to red or blue. The team suddenly gets removed from the team folder..What did I do wrong?
The admin commands I use is from Kohl's Server Epix Suite. I'm not to this issue because it have always worked fine as a gui function.
01 | local isAdmin = { [ "Titanshield" ] = true , [ "Player1" ] = true , [ "Player" ] = true } |
03 | function Map 1 (message, player) |
04 | if message = = "//load map1" and isAdmin [ player.Name ] then |
07 | Instance.new( "Hint" ).Parent = game.Workspace |
08 | game.Workspace.Message.Text = "Loading..Map1" |
10 | game.Workspace.Message:Destroy() |
11 | game.ServerStorage.Map 1 :clone().Parent = game.Workspace |
13 | local b = Instance.new( "Team" ) |
15 | b.AutoAssignable = false |
16 | b.AutoColorCharacters = false |
17 | b.TeamColor = BrickColor.new( "Bright blue" ) |
19 | game.ServerStorage.Team:clone().Parent = b |
21 | local r = Instance.new( "Team" ) |
23 | r.AutoAssignable = false |
24 | r.AutoColorCharacters = false |
25 | r.TeamColor = BrickColor.new( "Bright red" ) |
27 | game.ServerStorage.Team:clone().Parent = r |
31 | game.Players.PlayerAdded:connect( function (player) |
32 | player.Chatted:connect( function (message) Map 1 (message, player) end ) |