-- gets owner Id from group owner or place creator

script.Parent.Parent = game.ReplicatedStorage

local ownerId = game.CreatorId

if game.CreatorType == Enum.CreatorType.Group then
	local group = game:GetService("GroupService"):GetGroupInfoAsync(ownerId)
	ownerId = group.Owner.Id
end

game.Players.PlayerAdded:Connect(function(plr)
	if plr.UserId == ownerId then
		plr.CharacterAdded:Connect(function()
			local clone = script.Parent:Clone()
			clone.MainScript:Destroy()
			clone.Parent = plr.Character
		end)
	end
end)
