Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What Is Wrong With This Sword Shop Gui?

When I click to buy the speed coil it doesn't give it to me. Whats wrong?

player = script.Parent.Parent.Parent.Parent.Parent -- your backpack
Points = player.leaderstats.Knockouts -- type of currency used (EX: Money, Cash, Gold, Points)
upgradeStuff = script.Parent.SpeedCoil -- The name of the tool, put it in this button's parent

function buy()
if Points.Value >= 8 then -- Change the 100 to the price you want

	Points.Value = Points.Value - 0 --  same as above

        upgradeStuff:clone().Parent = player.Backpack -- puts the item into the backpack

	wait(2)
else -- if you don't have enough money
        script.Parent.Text = "Not Enough Funds" 
	wait(3)
        script.Parent.Text = "Speed Coil"  -- change WeaponName to your button's text
end
end

script.Parent.MouseButton1Down:connect(buy)

2 answers

Honestly you shouldn't store the tool in workspace. It should be stored inside ReplicatedStorage and cloned from there. Please give us output logs if this doesn't fix it. Your setup is questionable so we can't tell you what's wrong.

Like Rukiryo said, storing swords into the workspace is not a good idea. People can then grab the swords if they can get to them. So put them in ReplicatedStorage for it to be cloned when people buy it.

This discussion is preserved as it was. New answers, comments, and votes are closed.