SaveString (Method)

From Legacy Roblox Wiki
Jump to navigationJump to search
SaveString( string key, string value )
Returns nil
Description: Saves a string that can be reloaded from any server via LoadString. The DataCost used by a saved string can be removed by saving an empty string ("") as the value.
Member of: Player


Example

This code will save "Hi Player" when the player leaves the game.

game.Players.PlayerRemoving:connect(function(player) --Connection line. Fires when a player leaves the game.
	player:WaitForDataReady() --Waiting for the players data to be ready.
		player:SaveString("hi", "Hi Player")--When you load a string using this key, it will say "Hi Player"
	end
end)

See Also