Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.ReplicatedStorage.Remotes.EquipTool.OnServerEvent:Connect(function(player, item)
- if player.OwnedItems:FindFirstChild(item) then
- for i, ifthere in ipairs(player.Backpack:GetChildren()) do
- ifthere:Destroy()
- end
- for i, ifthere in pairs(player.Character:GetChildren()) do
- if ifthere:IsA("Tool") then
- if game.ServerStorage.Tools:FindFirstChild(ifthere.Name) then
- ifthere:Destroy()
- end
- end
- end
- local clone = game.ServerStorage.Tools:FindFirstChild(item):Clone()
- clone.ItemNumber:Destroy()
- clone.Cost:Destroy()
- clone.Parent = player.Backpack
- player.Equipped.Value = item
- game.ReplicatedStorage.Remotes.EquipTool:FireClient(player, item)
- end
- end)
Add Comment
Please, Sign In to add comment