local clickDetector = game.Parent
function onMouseClick()
-- Get a reference to an existing object
local original = workspace["Rick Astley"]
-- Create the model copy
local copy = original:Clone()
-- Parent the copy to the same parent as the original
copy.Parent = original.Parent
-- Move the copy so it's not overlapping the original
copy:SetPrimaryPartCFrame(CFrame.new(54.4, 0.5, -161.2))
end
COMMUNITY QUESTION
Why wont my click then clone script work for my rick roll game?
1 answer
The part of the script you forgot is the clickDetector.MouseClick:Connect(onMouseClick), The event of the clickdetector.
local clickDetector = game.Parent
function onMouseClick()
-- Get a reference to an existing object
local original = workspace["Rick Astley"]
-- Create the model copy
local copy = original:Clone()
-- Parent the copy to the same parent as the original
copy.Parent = original.Parent
-- Move the copy so it's not overlapping the original
copy:SetPrimaryPartCFrame(CFrame.new(54.4, 0.5, -161.2))
end
clickDetector.MouseClick:Connect(onMouseClick)
1 comment
0
didn't work. It said Workspace.Pepperonic Pizza.GiveItemScript:14: attempt to index nil with 'MouseClick'
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
the 'game' keyword is for the game,game don't has parent(s).
oh im so stupid
but still didn't work