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

Doesn't give tool on respawn, can someone please help?

This doesn't give the tool on respawn. Help, please?

Also, half the time it doesn't even load the sword at all unless I respawn my character since I already have the gamepass, but if someone buys the gamepass from ingame, it doesn't give them it on respawn. It's weird and I don't get it.

wait(2) 

GamepassID = 162597573
Tools = {"Dual Darkheart"}

GPS = Game:GetService("GamePassService")
function respawned(char)
	player = game.Players:FindFirstChild(char.Name)
	if char:FindFirstChild("Head") ~= nil then
		if GPS:PlayerHasPass(player, GamepassID) then
			for i = 1,#Tools do
				game.ServerStorage:FindFirstChild(Tools[i]):Clone().Parent = player.Backpack
			end
		else
		end
	end
end

game.Workspace.ChildAdded:connect(respawned)

2 comments

0

Well, if they buy in-game they need to be in a new server for it to work

0

Not always..

1 answer

game.Workspace.ChildAdded:connect(function(char)
if game.Players:GetPlayerFromCharacter(char)~=nil then
if game:GetService("GamePassService"):PlayerHasPass(162597573,game.Players:GetPlayerFromCharacter(char)) then
game:GetService("InsertService"):LoadAsset(108149175).Parent = game.Players:GetPlayerFromCharacter(char).Backpack
end
end
end)

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