Refresh Command: Assistance Needed

I’m currently wondering about how I could develop my refresh command, that’d execute a refresh on the player when stated “.refresh me” or “.ref me”. If I could obtain assistance on this, it’d be really appreciated.

This is what I had attempted so far:

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == ".refresh me" or ".ref me" then
			plr.CharactedAdded:Wait()
			wait()
			plr:LoadCharacter()
		end
end)
1 Like

plr:LoadCharacter would respawn their character. You can use msg:sub(start, end) to get a substring of msg.

Alright, the issue has been solved.