Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Vid_eo 126
8 years ago

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!

0
Just remove Line 7. Backpack is temporary, startergear isn't. TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
0
Answered by
Im_Kritz 334 Moderation Voter
8 years ago

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)
0
Ty! Vid_eo 126 — 8y
Ad

Answer this question