local clickDetector = script.Parent.ClickDetector
function onMouseClick()
end
clickDetector.MouseClick:connect(onMouseClick)
This is what i have so far. i know its just a clickdetector script that does nothing, but its groundwork. how could i edit this so that it gives you random items, (in this case, toys) everytime you click it? Thanks, hope i get answers soon.

3 comments
Where are the toys, in like replicated storage or server storage? You can clone one of the toys out from there into the player's backpack, and ps connect is deprecated in favour of Connect, and don't use global variables, onMouseClick is global, to make it local just do local function, just before function put local
okay so, ive kind of never scripted in my life
Where are the toys inside, what service