How would I make a disco/party chat command that changes the lighting in my game? I can add permissions to the command but the basic lighting change part won’t work. I’ve been trying for about an hour now and can’t seem to get it.
Chat command or GUI button? {{{30}}}
If it’s a chat command, Sorry I can’t help but I can make you an owner only Gui that enables and disables a custom disco mode and more.
Chat command! (30 charsssss)
An owner only disco button would be great!
1 Like
You can create a chat admin command using a script in ServerScriptService which detects when a player chats and checks if they have the permissions to use the command.
Example script (ServerScriptService):
local admins = {0,0} -- put userIds in here, seperated by a comma
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if table.find(admins, player.UserId) then
if message:lower() == ":disco" then
game.Lighting.ClockTime = 24 --example code to be run
end
end
end)
end)
If you have a GUI command you can make a script that detects when a player joins, checks if they’re an admin and puts the GUI into their PlayerGui.
Example script
local ui = 'path to ui'
local admins = {0,0}
game:GetService("Players").PlayerAdded:Connect(function(player)
if table.find(admins, player.UserId) then
local clonedUI = ui:Clone()
clonedUI.Parent = player.PlayerGui
end
end)
Thank you so much! VERY helpful!
Alright, I will work on it then send you it on a private message.