I’m making a shop GUI and when you equip a tool from it, it’ll only be given the next time you die or reset.
How can I do this? I tried a few things but it either just gave me more tools or just doesn’t work.
I’m making a shop GUI and when you equip a tool from it, it’ll only be given the next time you die or reset.
How can I do this? I tried a few things but it either just gave me more tools or just doesn’t work.
Is this tool a pass? And u could send your code, maybe it wont be that bad.
Nope, the tool isn’t a pass just bought with in-game currency. Currently the code is just replacing the current weapon you have and switching it with the new one equipped.
local RepStorage = game:GetService("ReplicatedStorage")
local Tools = RepStorage:WaitForChild("WeaponAttacks")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ToolName = script.Parent.ToolName.Value
script.Parent.Activated:Connect(function()
local toolfolder = Tools:WaitForChild(ToolName)
if toolfolder then
local tool = toolfolder:FindFirstChild(ToolName):Clone()
for i, v in pairs(Player.Backpack:GetChildren()) do
if v:IsA("Tool") and v.Name == ToolName then
v:Destroy()
end
end
tool.Parent = Player.Backpack
end
end)
U can use player:CharacterAppearanceLoaded() it will fire when haracter respawns