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.
local clickDetector = script.Parent.ClickDetector local GroupOfToys = --[[Set Variable, Like to a Folder of toys or a model or something with a group of toys ]]:GetChildren() function onMouseClick() local Given = GroupOfToys[math.random(1, #GroupOfToys)]:Clone() Given.Parent = --[[The Character]] end clickDetector.MouseClick:connect(onMouseClick)