I have a gun shop in my game. And whenever you buy a gun, where it says buy turns into equip. All of that works perfectly fine. Except whenever you try to equip it. I dont know how to update it so it checks if the player has the tool. This is the script:
player = game.Players.LocalPlayer
gun = player.StarterGear
Gunslot = player.GunSave
if script.Disabled == false then
script.Parent.MouseButton1Click:Connect(function()
if gun:FindFirstChild("Webley Mk IV") then
script.Value.Value = true
else
script.Value.Value = false
script.Value.Changed:Connect(function()
if script.Value.Value == false then
local a = gun["Webley Mk IV"]:Clone()
local b = a:Clone()
a.Parent = Gunslot
b.Parent = player.Backpack
end
end)
end
end)
end

1 comment
Thanks so much! Have a good day!