How do i make a custom rank for adonis? I'm confused

I finished writing the code and here it is:

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		local str = Message
		local split = str:split(' ')
		local command = split[1]
		local user = split[2]
		local tool = split[3]
		if command == ":give" or command == ":Give" then
			if game.ServerStorage:FindFirstChild(tool) then
				local Tool = game.ServerStorage:WaitForChild(tool):Clone()
				Tool.Parent = game.Players:FindFirstChild(user).Backpack
			end
		end
	end)
end)

Wow thank alot, this will fore sure help me with my cafe.

if User says :give USERNAME TOOLNAME then it would give the player the tool.

If this is what you were searching for please click the “Solution” button next to my post so everyone can know that this post is answered and no longer needed of help assistance.

If you run into an problem you can always message me on roblox or even add me if you wish to. My username is “XtsoostX” (XtsoostX - Roblox)

Im glad i helped you! :slight_smile:

it works as its supposed to, thanks alot

1 Like

No problem, i remember when i was making cafe games and i was always spending alot of time struggling with scripting so i wanted to help you abit.

with help of open ai i made it autofill the user : D

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		local str = Message
		local split = str:split(' ')
		local command = split[1]
		local user = split[2]
		local tool = split[3]
		if command == "!give" or command == "!Give" then
			local playerToGive = nil
			for _,p in pairs(game.Players:GetPlayers()) do
				if string.sub(p.Name, 1, #user):lower() == user:lower() then
					playerToGive = p
					break
				end
			end
			if playerToGive and game.ServerStorage:FindFirstChild(tool) then
				local Tool = game.ServerStorage:WaitForChild(tool):Clone()
				Tool.Parent = playerToGive.Backpack
			end
		end
	end)
end)

Im happy you customized the script but first make sure it has no bugs before putting it into your game :slight_smile:

i tested before posting the open ai version

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