Help with items

are you at the rank that is required?

1 Like

Yes I did a test by joined with other account.

No its not cloning can you do something?

Try printing Musket. If it is not cloning, Musket doesn’t exist or some other thing is happening

Try to make a if statement

if musket then
    print("musket is here")
end
1 Like

Are you sure Teams is defined? If not then make sure you have defined the “Teams” variable and assigned it to the correct team service. If not, you need to retrieve the Teams service before using it.

we told that before, i think its not the issue here

1 Like

I fixed that but still nothing,

Nope nothing I think that will never be solved

Then try debugging using my sample

if playerRank <= 1 then
		local guardTeam = Teams:FindFirstChild("Presintential Guard")
		if guardTeam then
			player.Team = guardTeam
			local musket = ReplicatedStorage:FindFirstChild("Musket") -- Musket has to be accessible
			if musket then
				local clone = musket:Clone()
				clone.Parent = Bp
				print("Musket added to backpack")
			else
				warn("Musket not found in ReplicatedStorage")
			end
		else
			print("Guard team not found")
		end
	elseif playerRank >= 2  then
		player.Team = Teams:FindFirstChild("Member Of The Greeks Parliament")
	elseif playerRank >= 3 then
		player.Team = Teams:FindFirstChild("Chiefs Of The Greek Presintential Guard")
	elseif playerRank >= 255 then
		player.Team = Teams:FindFirstChild("Prime Minister")
	end
end

The problem might be in whats happening on those lines check the output

1 Like

Then musket doesn’t exist. If it is not printing musket exists, then musket is not a valid member of RP

That’s why i sent him his debugged code version. Probably the musket is not being correctly accessed from ReplicatedStorage or actually doesn’t exists as you are saying

1 Like

…Nothing…My …topic is UNSOLVEABLE

Then it might be how PlayerAdded event is connected with your function. Also aren’t you using a LocalScript, are you?

No am not because its in serverscript service

Try debugging the player role

local playerRank = player:GetRankInGroup(33119741)
    print(player.Name .. "'s rank:", playerRank) -- Debug output to check player's rank
-- below the playerRank add the line above and run the game
1 Like