How do I make something duplicate into a player

Basically, there’s a magnet on top of my lobby. I want to use RocketPropulsion to drag them up when I say :magnet. I don’t know what i’m doing wrong. I’ve been researching and modifying for a while but I can’t figure out how to do it.
–SCRIPT WRITTEN BY CLEETUSCHAN–
local Players = game:GetService(“Players”)
local owner = {44314972}
function checkOwner(player)
for i = 1, #owner do
if owner[i] == player.userId then
return true
end
end
return false
end

function matchPlayer(str)
local result = nil

local players = game.Players:GetPlayers()

for i = 1,#players do
	if (string.find(string.lower(players[i].Name), string.lower(str)) == 1) then
		if (result ~= nil) then return nil end
		result = players[i]
	end
end

return result

end

local function Magnet()
local randomPlayer = game.Players:GetPlayers()
[math.random(1,#game.Players:GetPlayers())]
local original = workspace.RocketPropulsion
local copy = original:Clone()
copy.Parent = randomPlayer.Torso.Parent
end

game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if (msg == “:magnet”) then
if checkOwner(player) then
local findPlayer = matchPlayer(string.sub(msg, 7))
if findPlayer ~= nil then
Magnet()
end
end
end
end) – haha this looks like a checkmark :stuck_out_tongue:
end)
Basically it should put RocketPropulsion into a player from Workspace

1 Like

Did any errors appear in the output?

No I just don’t know how to do it, i wanted someone to modify the script and give notes to help me understand it and how it works