Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i define a player respawning if i can?

If not,

Answer this how would i make a player keep a item with his game pass if when the code is written like this

local passId = 281488416-- change this to your game pass ID.
 
function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end
 
game.Players.PlayerRespawned:connect(function(plr)
    if isAuthenticated(plr) then
        local dman = game.Lighting.Customs.Dmans["Dman's Dank Blue"]:Clone()
		dman.Parent = plr.Backpack
    end
end)

1 answer

✓ Accepted answer
local passId = 281488416

function isAuthenticaed(plr)
	return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		if isAuthenticated(player) then
			game.Lighting.Customs.Dmans["Dman's Dank Blue"]:clone().Parent = player.Backpack
		end
	end)
end)

3 comments

0

Let me know if this works.

0

Ty very much

0

clone() is deprecated. can you like explain your answers as well

This discussion is preserved as it was. New answers, comments, and votes are closed.