Actual Error: (i'm really stupid lol) While testing the script below, I was coping the money bag and inserting it directly into my backpack, forgetting that I need the gear to be inserted through the server script. (which I had, but to save time I did the copy and paste.) Thanks to everyone to helped!
Trying to make a vending machine to when you have a moneybag, it will remove it and give it to the player.
Problem is that it never makes it past the
if already ~= nil then
Is there something I am doing wrong?
--//Variables local clickdetector = script.Parent.ClickDetector local sound = script.Parent.Sound --//Code clickdetector.MouseClick:Connect(function(plr) print(plr.Name) --showing the player's name that clicked the button local already = plr.Backpack:FindFirstChild("Money Bag") --seeing if we can find the moneybag if already ~= nil then --checking if we found the moneybag print("Did this work?") sound:Play() --playing sound plr.Backpack["Money Bag"]:Destroy() --removing the moneybag wait(0.2) print("success") game.Lighting.BloxyCola:Clone().Parent = plr.StarterGear --giving the cola to the player's starter pack game.Lighting.BloxyCola:Clone().Parent = plr.Backpack --giving the cola to the player's current backpack end end)