Strange erroring with admin system

I’m trying to add an admin command system into my game but I have multiple errors where some lines refuse to comment out and this single event delays my entire script.

I did print(player.UserId,game.Creator) before the entire line of code but nothing happened.

I also tried using a task.spawn but it also still delayed the script doing nothing.

Edit: I changed the split variable to msgSplit because I realized it could’ve been the error but it also did nothing.

1 Like

Some of the lines are refusing to comment out because of the other double brackets within your print statement which are intended for indexing but are registered as the end of a multi-line string.

You mentioned a ‘single event’ causing delays, I don’t really understand. Can you explain what this event is, as well as provide some more context and code?

the Player.Chatted event

Commands:

local MessagingService = game:GetService("MessagingService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Signals = ReplicatedStorage.Signals
local Remotes = Signals.Remotes

local GLOBAL_TOPIC = "SHOUT"

MessagingService:SubscribeAsync(GLOBAL_TOPIC,function(message)
	Remotes.ToClient:FireAllClients(GLOBAL_TOPIC,message.Data)
end)


local Commands = {}

Commands.announce = function(messageData)
	MessagingService:PublishAsync(GLOBAL_TOPIC,messageData[2])
end

return Commands

Also I deleted the print statement and its still happening.

1 Like

You can do something like this instead:

Commands[(firedCommand[2])]

Add the parentheses around the index and it should work just fine without getting commenting errors.

1 Like

Oh yeahh, I didn’t see that. The player.Chatted event still doesn’t fire for some reason and I realized its because it can’t be used on server. I’m gonna swap to client and use TextChatService.

Nevermind it can be used on server, its just not working.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.