Adonis Custom Commands Help

Hello guys, I am having trouble on this:

--[[
	SERVER PLUGINS' NAMES MUST START WITH "Server: "
	CLIENT PLUGINS' NAMES MUST START WITH "Client: "
	
	Plugins have full access to the server/client tables and most variables.
	
	You can use the MakePluginEvent to use the script instead of setting up an event.
	PlayerChatted will get chats from the custom chat and nil players. 
	PlayerJoined will fire after the player finishes initial loading
	CharacterAdded will also fire after the player is loaded, it does not use the CharacterAdded event.
	
	service.HookEvent('PlayerChatted',function(msg,plr) 
		print(msg..' from '..plr.Name..' Example Plugin')
	end)
	
	service.HookEvent('PlayerJoined',function(p) 
		print(p.Name..' Joined! Example Plugin') 
	end)
	
	service.HookEvent('CharacterAdded',function(plr) 
		server.RunCommand('name',plr.Name,'BobTest Example Plugin') 
	end)
	
--]]

server = nil -- Mutes warnings about unknown globals
service = nil
return function()
	server.Commands.HostCommand = {
		Prefix = server.Settings.Prefix;	-- Prefix to use for command
		Commands = {"host"};	-- Commands
		Args = {"player"};	-- Command arguments
		Description = "Make a player a host.";	-- Command Description
		Hidden = false; -- Is it hidden from the command list?
		Fun = false;	-- Is it fun?
		AdminLevel = "Moderators";	    -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
		Function = function(plr,args)    -- Function to run for command
			--dont edit--
			for _, player in pairs(service.GetPlayers(plr, args[1])) do
			-- ---------------
			if player then 
				do
				print(player)
				local val = script.Host:Clone()
				val.value = true
val.Parent = player

				print("value created")
				local ServerScriptService = game:GetService('ServerScriptService')
				local ChatService = require(ServerScriptService:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
				local speaker = ChatService:GetSpeaker(player.Name)
				print("stats created")
				speaker:SetExtraData("Tags", {TagText = "HOST", TagColor = Color3.fromRGB(0, 255,0)})
				speaker:SetExtraData("ChatColor", Color3.fromRGB(0, 255,0))
				server.RunCommand("notify", player, "You have been made a Host.")
				server.RunCommand("n", player.Name.." has been given host permissions.")
				end
				end
			-----------------
			end
		end
	}
end

The thing is that it is throwing me a “Unknown error” via adonis admin, when I check in-game console it just prints the first player, aka print(player) it makes me think that the error is right after it but when I either create the value via script or have it a child of the script, it still dont works and the console throws no errors either, anyways can help me?
Adonis admin by @Sceleratis

2 Likes

To me it looks like you have a line with just player in it.
Not sure what that would do but it looks wrong to me.

Oh yeah, the line with player does works, like if i do
:host me
it prints iSt_xrm
But the thing is that it dont works after the print(player)

Ok so why not put a print after each line after that one so you can find out which line does not work.

Okay will try to do that but will see.

I found the error which was doing .Value instead of .value

Ok thanks for letting us know and good luck going forward.