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

This press on a button - get item script wont work?

When i press on a table, it should give me a chair from rep. storage, but it doesnt. Here's the script:

function FoldingChair()
	return game.ReplicatedStorage:WaitForChild("FoldngChair"):Clone()
end

script.Parent:WaitForChild("ClickDetector").MouseClick:connect(function(player)
	FoldingChair().Parent = player.Backpack
end)

Basically if you click on a click detector it SHOULD give you a folding chair, but it won't work.

1 answer

✓ Accepted answer

The Script works for me, did you missed a typo? you typed "FoldngChair" instead of FoldingChair, Make sure the script is a Script, not a LocalScript.

function FoldingChair()
    return game.ReplicatedStorage:WaitForChild("FoldingChair"):Clone()
end

script.Parent:WaitForChild("ClickDetector").MouseClick:connect(function(player)
    FoldingChair().Parent = player.Backpack
end)

1 comment

0

Thanks!

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