I am trying to make an admin command that will show a GUI that just says the player’s name and the platform they are on. I am using the Adonis Loader with a client plugin because it just errors with a server plugin. I
It is probably some really obvious problem but I can’t find it.
-- This is the client plugin script
client = nil
service = nil
return function()
client.Commands.platform = {
Prefix = client.Settings.Prefix; -- Prefix to use for command
Commands = {"platform"}; -- Commands
Args = {"player"}; -- Command arguments
Description = "Says what platform the player is on."; -- Command Description
Hidden = false; -- Is it hidden from the command list?
Fun = false; -- Is it fun?
AdminLevel = "Admins"; -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
Function = function(plr,args) -- Function to run for command
local UserInputService = game:GetService("UserInputService")
local isMobile = UserInputService.TouchEnabled
local isComputer = UserInputService.KeyboardEnabled
local isConsole = UserInputService.GamepadEnabled
local remoteEvent = game.ReplicatedStorage.events.PlatformCommand
for _, player in pairs(service.GetPlayers(plr, args[1])) do
if isMobile then
remoteEvent:FireServer("Mobile")
elseif isComputer then
remoteEvent:FireServer("Computer")
elseif isConsole then
remoteEvent:FireServer("Console")
end
end
end
}
end
-- This is the script that makes the GUI appear with the player and the platform.
local remoteEvent = script.Parent.Parent.ReplicatedStorage.events.PlatformCommand
local PlatformName = script.Parent.Parent.StarterGui.PlatformGUI.ImageLabel.PlatformInput
local name = script.Parent.Parent.StarterGui.PlatformGUI.ImageLabel.PlayerName
local tweenservice = game:GetService("TweenService")
remoteEvent.OnServerEvent:Connect(function(player, Platform)
PlatformName.Visible = true
PlatformName.PlatformInput.Text = Platform
name.Text = player.name
end)