|
| 01 Jan 2015 11:04 PM |
if(message:sub(1,6) == ":theme") and isAdmin(Admins, plrWhoChat.Name) then player = findTron(game.Players:GetChildren(), message:sub(8)) if player then game.Workspace.Intro.SoundId = player.ThemeID.Value game.Workspace.Intro:Play() end end
Issue: It does absolutely nothing, and this is the only broken command.
What It SHOULD do: 1) When an admin hits the command, It will look through the player's folder for a StringValue called "ThemeID" 2) When it does, swap the SoundId for "Intro" (Located in the WorkSpace) with the Value from ThemeID 3) once all that is said and done, Play the intro music!
What I know isn't the problem: 1) Syntax (No issues here, I've had this working for a while) 2) Location (Everything works UP TO the command launch, and I can't figure out where the issue lies, as the Lua Output GUI ROBLOX made shows nothing.) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2015 11:26 PM |
| Solved, created a work-around to solve issue. |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 02 Jan 2015 12:32 AM |
| I suggest remodeling your admin system because basing chat syntax conditionals to run functions and change properties is not the most efficient way. |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2015 02:32 AM |
| Not efficient, maybe. But it works for now! |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 02 Jan 2015 03:54 AM |
| Its not efficient because of how much memory it eats up if you add a few commands... |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2015 08:25 AM |
| I'll look into changing it, but in the mean time, only a few commands are in game. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 02 Jan 2015 03:52 PM |
I would suggest using a table, something like
local whiteList = { ["128GB"] = true; ["BillTrollberg"] = true; [1] = true; --Since there are no quotes this means userId, so this means ROBLOX since he is userId 1 }
local commands = { [":theme"] = function(player) print(player.Name .. " said :theme, I'm an example.") end;
[":reset"] = function(player) --Another example if player.Character then player.Character:BreakJoints() end end; }
game.Players.PlayerAdded:connect(function(player) if (whiteList[player.Name] or whiteList[player.userId] or (player.userId == game.CreatorId)) then player.Chatted:connect(function(input) if commands[input:lower()] then --If there is a function in the commands table commands[input:lower()](player) --Call the function if it exist end end) end end) |
|
|
| Report Abuse |
|
|