My purpose of this code is to delete the weapon in hand from the player and also the Starter Gear when a button is pressed. The code below is intended to just delete the tool from the hand. When I press the button nothing happens. How do I do this and also delete the weapon from starter gear?
game.Players.PlayerAdded:Connect(function(player)
script.Parent.MouseButton1Click:Connect(function()
local Character = player.Character or player.CharacterAdded:Wait()
--local player = game.Players:GetPlayerFromCharacter(Character)
local SG = player.StarterGear
local tool = Character:FindFirstChildOfClass("Tool")
--local name = tool.Name
if tool then
tool:Destroy()
end
end)
end)

3 comments
Sorry, the question is worded wrong. It's supposed to be "How do I delete the weapon in a players hand AND from Starter Gear?"
What type of script is this?
its a server script