How would I give players tools on spawn consistently after they buy them in my tool shop?

I am trying to get a script going that will give players tools on spawn after they have bought an item from a shop gui that I’ve made, For example… a player would buy a sword or something like that and I want it to be able to keep on giving the player that specific tool each time the player spawns in.

I have no idea where to start with this!!! So I’ve come here to ask for help with this question I have, I would appreciate it a lot if anyone can help me with it.

I’ve thought of using some kind of script that would happen every time the player’s character is loaded in and yeah I’ve started on that but then again, I have no idea where to start. I’ve tried to make a little starting point below but eh I need help :confounded:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local backpack = player:FindFirstChild("Backpack")
		
		--Checking if player has a tool--
		
	end)
end)

Make a data store that saves which item the player has bought

Oh sorry!! I forgot to mention that the player will only be keeping this item for the duration they are in the game. My bad :frowning:

ohh u can make a BoolValue like when they buy the weapon it sets the BoolValue to true and then the script gives the player their weapon every time they spawn if the BoolValue is true

I’ll try this out, ill update you on any issues if there is any, tyty

This is fine, I would maybe use a module that keeps track of what items the player owns. You could then loop through that and clone each item into their backpack. This could also be done with Values, but it’s all up to preference.

The boolValue worked!!! Thank you very much for this solution @JasutinPoru

1 Like