Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Vid_eo 126
8 years ago

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

Log in to vote
1
Answered by 8 years ago

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)
0
Thanks! Vid_eo 126 — 8y
Ad

Answer this question