Im trying to make a system where you can pull a gun from a vehicles trunk w/o duplicates.
I have checked around devforum to no avail (to be honest, your probably gonna find something on the devforum that i didnt :p)
– start of script
local ClickDetector = script.Parent.ClickDetector
local canGiveGun = true
ClickDetector.MouseClick(function(player)
– no idea why but broken line 3 “attempt to call a rbxscriptsignal value”
local backpack = player.Backack
local gun = game.ServerStorage["AR-15"]
local gunClone = gun:Clone()
for i,v in pairs(backpack:GetChildren()) do
if v.Name == "AR-15" then
print("you have a gun, lol")
end
end
if canGiveGun then
gunClone.Parent = backpack
end
canGiveGun = true
end)