Tool not working after respawn

Hello, so I scripted my gamepass simply, everything is functional.
I, however, have an issue with it, I placed a local script in StarterPlayer.StarterPlayerScripts, cloning the tool with it and placing the tool back in the backpack.
However, the tool doesn’t work, I checked the scripts in that tool, and the scripts are also normal.
Another issue is that, as I’m using the CharacterAdded event, sometimes while joining the game I get those tools, alongside the functional ones.

How do I fix these issues?
Script:

local MarketService = game:GetService("MarketplaceService")
local RadioID = 32001162
local Player = game.Players.LocalPlayer
local Radio = game.ReplicatedStorage.Radio:clone()

if MarketService:UserOwnsGamePassAsync(Player.UserId, RadioID) then
	print("Player owns the Radio Gamepass!")
	Player.CharacterAdded:Connect(function()
		Radio.Parent = Player.Backpack
	end)
end
--You better do that on the server:
local MarketService = game:GetService("MarketplaceService")
local RadioID = 32001162
local Radio = game.ReplicatedStorage.Radio

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Char)
		if MarketService:UserOwnsGamePassAsync(Player.UserId,RadioID) then
			local tool = Radio:Clone()
			tool.Parent = Player.Backpack
		end
	end)
end)

1 Like

I thought CharacterAdded only worked on Local Scripts, it’s working now, appreciated

1 Like