Please help with this

Code:

game.ReplicatedStorage.AdminPanelEvents.RankPromotion.OnServerEvent:Connect(function(PlayerToGiveRankTo, Reason, Rank)
	print(PlayerToGiveRankTo.."'s has been promoted to "..Rank.."!")
	game.Players:FindFirstChild(PlayerToGiveRankTo).leaderstats.Rank.Value = Rank
end)

the error is on the line "game.Players:FindFirstChild(PlayerToGiveRankTo).leaderstats.Rank.Value = Rank"

7 comments

0

don't try to concatenate the variable

0

what do you mean?

0

Can you put your script in a code block?

0

in a block?

0

whats the error

0

someone can please help fix this

0

Because your using the player isntance. Use PlayerToGiveRankTo.Name