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

How would I make it so that a tool gets in a player's inventory for only one life?

I made a script so that when you clicked on a table, you got a Rage Table, but I have no idea how I would make it in the player's inventory for only one life

Here's the script so far(It's in the player's starter gear when they click on the table in the script)

function rageTable()
	return game.ReplicatedStorage:WaitForChild("RageTable"):Clone()
end

script.Parent:WaitForChild("ClickDetector").MouseClick:connect(function(player)
	rageTable().Parent = player.Backpack
	rageTable().Parent = player.StarterGear
end)

Thanks!

1 comment

0

Just remove Line 7. Backpack is temporary, startergear isn't.

1 answer

✓ Accepted answer

Going off of what TheDeadlyPanther said. All you need to do is remove the line that puts the tool into the StarterGear because that causes the player to spawn with that tool.

So final code will look like:

function rageTable()
    return game.ReplicatedStorage:WaitForChild("RageTable"):Clone()
end

script.Parent:WaitForChild("ClickDetector").MouseClick:connect(function(player)
    rageTable().Parent = player.Backpack
end)

1 comment

0

Ty!

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