I am helping [redacted XD] make a rockfeller street remix sorta thing and I was helping him with the shop, when I finally fixed all the errors and clicked the buy button, no errors came up and I didn't get the item. Script:

local clickdetector = script.Parent:WaitForChild("ClickDetector")
Item = game.ServerStorage.LightStick

clickdetector.MouseClick:Connect(function(player)
	if player.leaderstats["Meme Points"].Value < 5 then
		script:Clone()
		script:Destroy()
		wait(0.1)
	end
end)
clickdetector.MouseClick:Connect(function(player)
		if player.leaderstats["Meme Points"].Value >= 5 then
		player.leaderstats["Meme Points"].Value = player.leaderstats["Meme Points"].Value - 5
		Item:Clone()
		Item.Parent = player.Backpack
		end
end)

I don't know what the problem is but please help

2 comments

0

I'm not sure myself but try adding a variable to "Item" on line 14. Might help. Try: local ClonedItem = Item:Clone()      ClonedItem.Parent ) player.Backpack

0

It could also be becuase the player has less than 5 points. The script would get cloned & destroyed. But since you never set the parent of the cloned script it would get completely deleted. Always a good idea to debug with "print()"